[dirGames-L] editable text sprites
Blixem Media | Marco Christis
marco at blixem.com
Tue Oct 18 18:38:03 EDT 2005
Hi,
I'm building a text tool and I'm struggling with the text sprites.
Especially with the keyboardFocusSprite. Is there a special order to
initialize sprites with editable text members?
I have been trying with sprite.editable and member.editable and the
keyboardFocusSprite in many possible combinations and orders but I can't
get is to work properly.
Do any of you know whether there are any quirks that you have to keep in
account? For example I noticed that I have to set the editable of a
sprite to false before placing the sprite to an off-screen position. (I
do this sometimes to make the sprite invisible.) Otherwise the
sprite.editable on my other sprites stop to work.
Sometimes when I check sprite(the keyboardFocusSprite).member.type and
it is #empty even though the keyboardFocusSprite is not 0 or -1.
The goal that I am trying to achieve is to make a text tool that can do
the following:
- create a new text box when you click on the canvas with the 'text
tool'. The new created text box is editable.
- stop editing the text box when you click outside the text box.
- edit an existing text box when you click on it with the 'text tool'.
- select an existing text box with the 'selection tool'. Preferably
without making the textbox editable.
- a selected textbox is can be moved or be resized. (But this for later
concern.)
I create new text members with new(#text, castlib "tmp"). I'm working
only with text members, no field members.
I use dynamical generated sprites using the following code to initialize
the sprites.
sprite(channel).puppet = true
sprite(channel).member = myMember
sprite(channel).locZ = z
sprite(channel).forecolor = 255
sprite(channel).backcolor = 0
sprite(channel).visible = true
sprite(channel).blend = 100
sprite(channel).ink = 0
Sprite(channel).cursor = 0
case myMember.type of
#shape:
Sprite(channel).lineSize = 1
end case
Does anybody have any suggestions what to try or what to do to get the
keyboardFucusSprite to work properly? I have the feeling that there is a
special order to make a sprite/member editable and to give it the
keyboard focus. And to stop it being editable and to give another sprite
the keyboard focus. But I can't get it figured out.
Thanks,
Marco.
More information about the dirGames-L
mailing list