[racket-users] Re: Creating movable Fonts on a Canvas

2019-06-24 Thread Amir Teymuri
Wow, this is a great blog! Many Thanks!

On Monday, June 24, 2019 at 2:52:35 AM UTC+2, Alex Harsanyi wrote:
>
> Have a look at the `snip%` and `pasteboard%` classes: you can represent 
> each glyph using a `snip%` and the pasteboard will handle the moving it 
> with the mouse.  You can derive the `snip%` and `pasteboard%` objects to 
> add new functionality -- this is easier than implementing a mouse move 
> operation using the `canvas%`  `on-event` method.
>
> While not exactly what you need, I wrote a blog post about using `snip%` 
> objects, and in the first example, the chess pieces themselves are actually 
> Unicode Glyphs, so you could easily modify it to have different 
> Glyphs/Letters that can be moved around in a canvas:
>
>
> https://alex-hhh.github.io/2018/10/chess-game-using-racket-s-pasteboard.html
>
> Alex.
>
> On Monday, June 24, 2019 at 4:40:34 AM UTC+8, Amir Teymuri wrote:
>>
>> If i want to use fonts on a canvas in a way that each single Glyph/Font 
>> is movable around the canvas by mouse, is it a good idea to have a class 
>> drivative of canvas% for each new font and then override the on-event 
>> method of them to update its coordinates on the main canvas? Or is there a 
>> better more effiicient way for doing this?
>>
>> Greetings,
>> Amir
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/b5e149fc-87c5-4ac0-9e09-90d058e4f56e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: Creating movable Fonts on a Canvas

2019-06-23 Thread Alex Harsanyi
Have a look at the `snip%` and `pasteboard%` classes: you can represent 
each glyph using a `snip%` and the pasteboard will handle the moving it 
with the mouse.  You can derive the `snip%` and `pasteboard%` objects to 
add new functionality -- this is easier than implementing a mouse move 
operation using the `canvas%`  `on-event` method.

While not exactly what you need, I wrote a blog post about using `snip%` 
objects, and in the first example, the chess pieces themselves are actually 
Unicode Glyphs, so you could easily modify it to have different 
Glyphs/Letters that can be moved around in a canvas:

https://alex-hhh.github.io/2018/10/chess-game-using-racket-s-pasteboard.html

Alex.

On Monday, June 24, 2019 at 4:40:34 AM UTC+8, Amir Teymuri wrote:
>
> If i want to use fonts on a canvas in a way that each single Glyph/Font is 
> movable around the canvas by mouse, is it a good idea to have a class 
> drivative of canvas% for each new font and then override the on-event 
> method of them to update its coordinates on the main canvas? Or is there a 
> better more effiicient way for doing this?
>
> Greetings,
> Amir
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/71492a5d-ba15-4191-9a74-67880e36cb88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.