Simple geometry question
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 56
- Joined: Sat Jun 20, 2009 2:41 pm
Simple geometry question
I've got a colored stripe that goes across the top of a card. I want it to go from edge to edge no matter what size the screen...
In a smaller window it goes all the way from left side to right side.
If you resize the window it comes up short. (i.e- it seems to stay the same size)
I've tried the "scale selected object" but when you resize, it seems to make no difference...
Thanks!
In a smaller window it goes all the way from left side to right side.
If you resize the window it comes up short. (i.e- it seems to stay the same size)
I've tried the "scale selected object" but when you resize, it seems to make no difference...
Thanks!
Simple geometry question
Hi,
You can try this (if i unsertand what do you need. I speak french)
All the best
Jean-Marc
You can try this (if i unsertand what do you need. I speak french)
Code: Select all
on moveAnImg
put 1000 into tTime
put "myImage" into tNameImage
put (the width of this stack)-10 into tWs
put 10 into tLeft
put 10 into tTop
put tleft,tTop into depLoc
put tWs,tTop into ArrLoc
move img tNameImage from depLoc to ArrLoc in tTime milliseconds
end moveAnImg
Jean-Marc
Dear TodayIsTheDay,
Animations are always fun, but I don't think that's the solution this time. If I understand you correctly, you want the following:
Best,
Mark
Animations are always fun, but I don't think that's the solution this time. If I understand you correctly, you want the following:
Code: Select all
put the topleft of grc "Wide Line" into myTL
set the width of grc "Wide Line" to the width of this cd
set the topleft of grc "Wide Line" to myTL
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hi todayistheday,
if you want the graphic or image to reszize with the stack then activate the object you want by selecting it and look in the property inspector for geometry. There you can "attach" the object so it resizes when the size of the card/stack is changed. Look in the user guide pdf for geomety manager.
What version of RunRev are you using?
regards
Bernd
if you want the graphic or image to reszize with the stack then activate the object you want by selecting it and look in the property inspector for geometry. There you can "attach" the object so it resizes when the size of the card/stack is changed. Look in the user guide pdf for geomety manager.
What version of RunRev are you using?
regards
Bernd
-
- Posts: 56
- Joined: Sat Jun 20, 2009 2:41 pm
If I don't use the geometry settings how will I get all of the 27 cards in my program, some with many many text boxes, to resize correctly at runtime?
Would I have to code each card and item on that card?
I want to learn the best way to do things in RR... if it take a little longer but is better then maybe I should do it that way...
Would I have to code each card and item on that card?
I want to learn the best way to do things in RR... if it take a little longer but is better then maybe I should do it that way...
Dear TodayIsTheDay,
If you use the GM for complex lay-outs with a lot of objects, the chance is very large that it will stop working at some point.
By composing your lay-out i a smart way, you can limit the number of objects that need to be moved or resized. Usually, I have only on group with a few fields that need adjustment after the window resizes. If possible, try to work with groups on multiple cards and use the same script to resize the objects in these groups. Try to keep things simple. That is pleasant for you as a programmer, but also for the user who needs to understand how the interface works.
Best regards,
Mark
If you use the GM for complex lay-outs with a lot of objects, the chance is very large that it will stop working at some point.
By composing your lay-out i a smart way, you can limit the number of objects that need to be moved or resized. Usually, I have only on group with a few fields that need adjustment after the window resizes. If possible, try to work with groups on multiple cards and use the same script to resize the objects in these groups. Try to keep things simple. That is pleasant for you as a programmer, but also for the user who needs to understand how the interface works.
Best regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
hi,
Mark would this be ok in a stack script?it works but do you see problems with the basic approach?
regards
Bernd
Mark would this be ok in a stack script?
Code: Select all
on resizestack
put the width of the current card into tWidth
put the left of the current card into tLeft
lock screen
set the width of graphic "g1" of the current card to tWidth
set the left of graphic "g1" of the current card to tLeft
set the width of image "i1" of the current card to tWidth
set the left of image "i1" of the current card to tLeft
unlock screen
end resizestack
regards
Bernd
Hi Bernd,
That should work, but I don't understand why you'd put the left of a card into a variable...?
Best,
Mark
That should work, but I don't understand why you'd put the left of a card into a variable...?
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hi Mark,
thanks for confirming.
regards
Bernd
thanks for confirming.
it was just bad coding, I started out in a different direction and did not clean up. Now a cleaner version. Of cours this would fail if one would go to a card that has not a graphic or an image of that name. (One would test for the controls one wants to resize, or you make shure they are one each card. Or you put them into a group with background behavior turned on)but I don't understand why you'd put the left of a card into a variable...?
Code: Select all
on resizestack
lock screen
set the width of graphic "g1" to the width of this card
set the left of graphic "g1" to the left of this card
set the width of image "i1" to the width of this card
set the left of image "i1" to the left of this card
unlock screen
end resizestack
Bernd
Hi Mark,
I get it: you mean why I set the left of the image to the left of the card.
Well if I dont set the left of the image I will have an image of the width of the card that does not adjust its loc to the new loc. By setting the left after increasing the size of the image it is at the right place.
Is it that what you mean?
regards
Bernd
I get it: you mean why I set the left of the image to the left of the card.
Well if I dont set the left of the image I will have an image of the width of the card that does not adjust its loc to the new loc. By setting the left after increasing the size of the image it is at the right place.
Is it that what you mean?
regards
Bernd
Hi Bernd,
No. My question is: why don't you simply use 0 instead of the left of the card? OK, sorry, I couldn't resist to tease you a little.
Best,
Mark
No. My question is: why don't you simply use 0 instead of the left of the card? OK, sorry, I couldn't resist to tease you a little.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Anyway... that script should work fine. There are no problems with that. The problem is only that a general solution, such as the GM, eventually breaks. I think that a general solution is possible, as long as it isn't too ambitious and the GM is way too ambitious. I know this by experience.
Best,
Mark
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode