Page 1 of 1
Is it possible to lock the size of an object?
Posted: Sun Sep 30, 2012 1:59 am
by Newbie4
I am creating graphics problematically for the user to move around but I do not want the user to be able to change the size of them. Is there a way to do this? There is a lockLoc but no lockSize, lockWidth or lockHeight
Re: Is it possible to lock the size of an object?
Posted: Sun Sep 30, 2012 4:54 am
by FourthWorld
lockLoc could more accurately be called lockRect, as it locks all aspects of the object's position.
Re: Is it possible to lock the size of an object?
Posted: Sun Sep 30, 2012 3:52 pm
by Newbie4
Thank you for the reply
That is the problem, lockLoc locks everything.
I do want to let them move it around. I just do not want them to accidentally change the sizes.
I want to lock the size but not prevent the users from positioning it
Re: Is it possible to lock the size of an object?
Posted: Sun Sep 30, 2012 4:05 pm
by FourthWorld
Don't provide a pointer tool mode for your users and they'll have no means of resizing the objects.
Re: Is it possible to lock the size of an object?
Posted: Sun Sep 30, 2012 6:32 pm
by Klaus
Yep, please spread the word: Standalone <> IDE!
In a standalone the user will only be able to do things that YOU, the developer, will allow him!
Re: Is it possible to lock the size of an object?
Posted: Sun Sep 30, 2012 7:36 pm
by sturgis
Look at "grab" in the dictionary. As the others mentioned, you don't have to provide a way to "select" the object (as in edit mode of the ide) if you want it movable, just use grab to allow it to be moved around and the problem goes away entirely.
Re: Is it possible to lock the size of an object?
Posted: Mon Oct 01, 2012 12:34 am
by Newbie4
Thank you all. Those are all good answers and conceptually, they make sense.
The problem is, I do not know how to do what you are suggesting and can't find any examples or documentation on it. I looked in the Dictionary, Resources, Lessons and found not much to help on those topics. I read a number of forum links but they are mostly on interactive/developer tasks
I hate to bother you again but...
1) How do you use the "grab" to grab an object, drag it and then let it go? At that point I want to lock the location of that graphic.
2) How do you turn off the 'pointer tool mode' for the user?
Thank you all for your help and I apologize for being dumb and asking so many questions.
Re: Is it possible to lock the size of an object?
Posted: Mon Oct 01, 2012 1:32 am
by sturgis
To see how it might work (this is a VERY simple example, hard to know how to give a more concrete example without knowing what you're trying to end up with)
Create a new mainstack.
Drop a graphic on it, I used a rectangle.
Set the "opaque" property of the rectangle to true in the inspector.
Edit the script of the rectangle and put the following
Code: Select all
on mouseDown
grab me
end mouseDown
Apply the changes to the script, then go into run mode, click and drag the square and it should follow right along. Release the mouse button and it stays where you put it.
As indicated by Klaus, when you build a standalone, run mode is the default, you have to specifically go out of your way to code methods to select objects so that you can access their "handles". In the IDE of course thats not the case.
Also, don't know if you've been referred to these resources yet..
http://www.runrev.com/developers/docume ... rs-course/
http://lessons.runrev.com/
Both are very helpful when you're just starting out.