Resize Text of Button or field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Resize Text of Button or field
I have read through the lesson on resizing text of field. When my stack resizing to the differnet mobile devices the test of the button or field stays the same. I can figure out how to change the size of text in a field, but I don't know how to script it for all the objects on my stack. I have several different cards with different IDs. How would I go about do this?
Re: Resize Text of Button or field
Hi.
Do you mean to set the "textSize" of the other objects in your stack? This works for buttons, scrollbars, etc.
Craig NEwman
Do you mean to set the "textSize" of the other objects in your stack? This works for buttons, scrollbars, etc.
Craig NEwman
Re: Resize Text of Button or field
When my stack resizes the text for my buttons, fields, and nab bars stay the same size. I don't know how to change it. I have so many objects across all my cards. I can figure out how to change one field but not the rest of the objects.
Re: Resize Text of Button or field
I am still missing what you mean.
Have you tried setting "the textSize" of the other objects in your stack? How did you change this value for the field that you mentioned you had no issue with?
This can be scaled to the screenSize of the device you are writing for, using some baseline.
Craig
Have you tried setting "the textSize" of the other objects in your stack? How did you change this value for the field that you mentioned you had no issue with?
This can be scaled to the screenSize of the device you are writing for, using some baseline.
Craig
Re: Resize Text of Button or field
I want the button name or the words in the text field to scale with the stack. If I adjust the size of the stack the text stays the same. I don't know how write a script to fix this in all my cards. I have script to adjust the objects on my cards and the adjust fine, but the text stays the same and never adjusts. I hope this is more clear.
Re: Resize Text of Button or field
Hi marcelloe,
Are you using my little resizing script?
I had stopped at text size because there is much work to do.
You will have to figure out a baseline as Craig suggested this means
if tHeight >= some number then
put 14 into tLetterSize
if tHeight >= some greater number then
put 18 into tLetterSize
Because there aren't infinite number of font sizes to use.
You would then set the fontSize of all your fields/buttons to the tLetterSize.
How to determine if it's a button or field?
if word 1 of the long id of the control is "button" then --this is part of the loop. (not real code)
--do your stuff
Ok that is my simple form as I'd use in that resizing script.
Simon
Edit: But again you should be looking at liveCode 6.5
Are you using my little resizing script?
I had stopped at text size because there is much work to do.
You will have to figure out a baseline as Craig suggested this means
if tHeight >= some number then
put 14 into tLetterSize
if tHeight >= some greater number then
put 18 into tLetterSize
Because there aren't infinite number of font sizes to use.
You would then set the fontSize of all your fields/buttons to the tLetterSize.
How to determine if it's a button or field?
if word 1 of the long id of the control is "button" then --this is part of the loop. (not real code)
--do your stuff
Ok that is my simple form as I'd use in that resizing script.
Simon
Edit: But again you should be looking at liveCode 6.5
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Resize Text of Button or field
To use LC 6.5 to scale the stack I would use the following script. Correct me if I am wrong, but I thought this will only scale the stack to fit the screen. It will not size the objects on your cards.
on preOpenStack
set fullScreenMode to "exact Fit"
end preOpenStack
on preOpenStack
set fullScreenMode to "exact Fit"
end preOpenStack
Re: Resize Text of Button or field
Hi marcelloe,
Have you tried it?
Simon
Have you tried it?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Resize Text of Button or field
I have figured out how to use the fullScreenMode script, but I have ran into a couple of issues.
1. my swipe script stopped working.
2. the 1st card scales fine, but the rest of the cards don't scale right. Everything is in the bottom left hand corner.
This is the swipe script I am using.
# the event id and initial swipe time and position
local sTouchId, sInitTime, sInitX
# maximum swipe time in millisecs
local sSwipeTime
# minimum swipe distance
local sSwipeDistance
on openStack
# set up swipe values - experiment with these for required effect
put 500 into sSwipeTime
put 150 into sSwipeDistance
end openStack
on touchMove pId, pX, pY
if pId <> sTouchId then
# record initial values for start of swipe
put pId into sTouchId
put the millisecs into sInitTime
put pX into sInitX
end if
# check the action was fast enough for a swipe
if the millisecs - sInitTime <= sSwipeTime then
# check we have covered enough distance
put pX - sInitX into tDistanceX
if abs(tDistanceX) > sSwipeDistance then
if tDistanceX < 0 then
# finger is swiping left
send "swipeLeft" to me in 0 millisecs
else
# finger is swiping right
send "swipeRight" to me in 0 millisecs
end if
end if
end if
end touchMove
command swipeLeft
visual effect scroll left normal
go next card
end swipeLeft
command swipeRight
visual effect scroll right normal
go prev card
end swipeRight
1. my swipe script stopped working.
2. the 1st card scales fine, but the rest of the cards don't scale right. Everything is in the bottom left hand corner.
This is the swipe script I am using.
# the event id and initial swipe time and position
local sTouchId, sInitTime, sInitX
# maximum swipe time in millisecs
local sSwipeTime
# minimum swipe distance
local sSwipeDistance
on openStack
# set up swipe values - experiment with these for required effect
put 500 into sSwipeTime
put 150 into sSwipeDistance
end openStack
on touchMove pId, pX, pY
if pId <> sTouchId then
# record initial values for start of swipe
put pId into sTouchId
put the millisecs into sInitTime
put pX into sInitX
end if
# check the action was fast enough for a swipe
if the millisecs - sInitTime <= sSwipeTime then
# check we have covered enough distance
put pX - sInitX into tDistanceX
if abs(tDistanceX) > sSwipeDistance then
if tDistanceX < 0 then
# finger is swiping left
send "swipeLeft" to me in 0 millisecs
else
# finger is swiping right
send "swipeRight" to me in 0 millisecs
end if
end if
end if
end touchMove
command swipeLeft
visual effect scroll left normal
go next card
end swipeLeft
command swipeRight
visual effect scroll right normal
go prev card
end swipeRight