drawing and erasing lines

Started by HandsFree, Sat 28/03/2015 00:29:31

Previous topic - Next topic

HandsFree

Don't know if this belongs in beginners question or not, so please move this post if needed. :)

We had this idea to show a note with a lot of letters and the player would be able to underline certain letters by clicking on them (and erasing the line by clicking again).

I have no idea how to script that. :confused:
I assume the note closeup should be a new room and the first problem is to register on what letter the player has clicked. Put a whole lot of screen coordinates in a struct/array thing and check that on (Mouse.IsButtonDown(eMouseLeft)==true)? Something like that? Is it also possible to register a leftclick (when mousebutton is released rather than pressed)?
Is there an easier way to do this?

Then use DrawLine to underline the letter? If so, is it possible to erase the line later if the player clicks it again?
Is there another/better way?

thanks

Cassiebsg

Never coded such a thing, but sounds like a fun challenge to do. (nod)

You don't need a new room, a GUI is probably a better option. Then you can use a button for each letter on the note, and you could then code the press/unpress of the button with different sprites (underline/not underline)... 

But am sure some of the more experienced coders on this forum, will come up with a better solution than mine. ;)
There are those who believe that life here began out there...

SMF spam blocked by CleanTalk