Discuss Scratch
- maxhup010
-
57 posts
Variable Positioning
Hey!
I have been working on a couple of projects that use movable window designs for a UI and have ran into some problems with the large variable showing where a couple of simple blocks could help! (These blocks would act similar to SOME motion blocks)
(These blocks could be under a little dropdown in variables to prevent scaring new scratchers away from variables… or not, whatever)
Generally these blocks could be used to have a better UI that can change whilst still looking neat!
EDIT:
There are many other blocks people are suggesting for variables too!
So i created A MUCH BIGGER topic for you all: containing 7 possible blocks
HERE
I have been working on a couple of projects that use movable window designs for a UI and have ran into some problems with the large variable showing where a couple of simple blocks could help! (These blocks would act similar to SOME motion blocks)
(These blocks could be under a little dropdown in variables to prevent scaring new scratchers away from variables… or not, whatever)
move [variable v] to x:() y:() :: variables
([var v] x position :: variables reporter)
([var v] y position :: variables reporter)
Generally these blocks could be used to have a better UI that can change whilst still looking neat!
EDIT:
There are many other blocks people are suggesting for variables too!
So i created A MUCH BIGGER topic for you all: containing 7 possible blocks
HERE
Last edited by maxhup010 (May 30, 2016 10:09:41)
- Sheep_maker
-
1000+ posts
Variable Positioning
I think only this block
set location of [var v] to x:(0)y:(0)::variables//default values are sprite's current positionis necessary, assuming that the center of a variable reader is the top-left corner.
Last edited by Sheep_maker (May 29, 2016 04:20:59)
- maxhup010
-
57 posts
Variable Positioning
Yep. Agreed I think only this blockset location of [var v] to x:(0)y:(0)::variables//default values are sprite's current positionis necessary, assuming that the center of a variable reader is the top-left corner.
- A-KouZ1
-
100+ posts
Variable Positioning
Did you mean…? uses single variable for positioning?
woh that's easy workaround,
Well, if you want to read it, just do…
Badly, forY Position, is does not support decimals
woh that's easy workaround,
define set position to x(a) y(b)
set [position v] to ((((a)+[240])mod[480])+((((b)+[160])mod[360])*[480])
Well, if you want to read it, just do…
go to x: (((position) mod [480])-(240)) y: (([floor v] of ((position)/[480]))-[180])
Badly, forY Position, is does not support decimals
Last edited by A-KouZ1 (May 29, 2016 12:53:28)
- ivancr72
-
100+ posts
Variable Positioning
No, it's “moving the variable”, not “storing a position on a variable”. Did you mean…? uses single variable for positioning?
woh that's easy workaround,define set position to x(a) y(b)
set [position v] to ((((a)+[240])mod[480])+((((b)+[160])mod[360])*[480])
Well, if you want to read it, just do…go to x: (((position) mod [480])-(240)) y: (([floor v] of ((position)/[480]))-[180])
Badly, forY Position, is does not support decimals
- Breck-
-
100+ posts
Variable Positioning
Support for these:
move [variable v] to x:() y:() :: variables
([var v] x position :: variables reporter)
([var v] y position :: variables reporter)
- maxhup010
-
57 posts
Variable Positioning
Yeah… Whatever blocks, as long as they do the job. Support for these:move [variable v] to x:() y:() :: variables
([var v] x position :: variables reporter)
([var v] y position :: variables reporter)
- rasmusolle
-
100+ posts
Variable Positioning
THOSE… BLOCKS…….. I CAN'T…. LIVE WITHOUT…… THEM…. ANYLONGER……
- Scratcher1002
-
1000+ posts
Variable Positioning
Support for these:move [variable v] to x:() y:() :: variables
([var v] x position :: variables reporter)
([var v] y position :: variables reporter)
- A-KouZ1
-
100+ posts
Variable Positioning
No, it's “moving the variable”, not “storing a position on a variable”.
Oh, I understand, somewhat like gliding variable thing, right?
define glide variable to x:(x) y:(y) by(n) secs
set [temp x v] to (var x)
set [temp y v] to (var y)
set [timecyc v] to (timer)
repeat until <(timer)>((timecyc)+(n))>
set [var x v] to ((temp x)+(((x)-(temp x))*(((timer)-(timecyc))/(n))))
set [var y v] to ((temp y)+(((y)-(temp y))*(((timer)-(timecyc))/(n))))
go to x: (var x) y: (var y)
end
set [var x v] to (x)
set [var y v] to (y)
Could try it?
- maxhup010
-
57 posts
Variable Positioning
No, ill try explain it in more detail, sorry if i sound patronising, i dont mean to be…No, it's “moving the variable”, not “storing a position on a variable”.
Oh, I understand, somewhat like gliding variable thing, right?define glide variable to x:(x) y:(y) by(n) secs
set [temp x v] to (var x)
set [temp y v] to (var y)
set [timecyc v] to (timer)
repeat until <(timer)>((timecyc)+(n))>
set [var x v] to ((temp x)+(((x)-(temp x))*(((timer)-(timecyc))/(n))))
set [var y v] to ((temp y)+(((y)-(temp y))*(((timer)-(timecyc))/(n))))
go to x: (var x) y: (var y)
end
set [var x v] to (x)
set [var y v] to (y)
Could try it?
In scratch you can show a variable, but you have to drag it to where you want the information to be displayed… This is a massive limitation if you have multiple different screen layouts as you would have to base your layout around where the variable is… So if you could get a variable to go to a place on the screen (X & Y Coordinates) then you can have a User Interface that can adapt to the situation!
Hope that helps
- A-KouZ1
-
100+ posts
Variable Positioning
In scratch you can show a variable, but you have to drag it to where you want the information to be displayed… This is a massive limitation if you have multiple different screen layouts as you would have to base your layout around where the variable is… So if you could get a variable to go to a place on the screen (X & Y Coordinates) then you can have a User Interface that can adapt to the situation!
Hope that helps
Ah, I'm understand it now

Yeah, I need this block too,
Support!
anyway,
maybe I can suggest:
show variable [ v] as [slider v]::variables
set position of list [ v] to x:() y:()::list
set size of list to width() height()::list
- nerdiebirdy
-
500+ posts
Variable Positioning
bump
Great idea! This would be useful for having a variable you want to appear in different areas of the screen.
Perhaps you could also add these:
Great idea! This would be useful for having a variable you want to appear in different areas of the screen.
Perhaps you could also add these:
change [variable v] x by []::variables
change [variable v] y by []::variables
- j3r0_plays
-
100+ posts
Variable Positioning
No support, you can manually move em and use text engines and i know like 1000 workarounds. No.
- scratch978654
-
100+ posts
Variable Positioning
Congrats on bumping a 4 year old topic.
Semi-support. In fact, 25% support.
You can just set variables to each other and move them to positions, or use your own text.
And if “your palette gets flooded”, then you can use lists. And if that gets flooded too, use say blocks.
Semi-support. In fact, 25% support.
You can just set variables to each other and move them to positions, or use your own text.
And if “your palette gets flooded”, then you can use lists. And if that gets flooded too, use say blocks.
- A-KouZ1
-
100+ posts
Variable Positioning
Still 1000% support.
Text engine is expensive.
Using sprites is the waste of source.
It's better to have it for small projects.
I guess
Text engine is expensive.
Using sprites is the waste of source.
It's better to have it for small projects.
I guess
- wasdcoceoe
-
100+ posts
Variable Positioning
Hey!
I have been working on a couple of projects that use movable window designs for a UI and have ran into some problems with the large variable showing where a couple of simple blocks could help! (These blocks would act similar to SOME motion blocks)
(These blocks could be under a little dropdown in variables to prevent scaring new scratchers away from variables… or not, whatever)move [variable v] to x:() y:() :: variables
([var v] x position :: variables reporter)
([var v] y position :: variables reporter)
Generally these blocks could be used to have a better UI that can change whilst still looking neat!
EDIT:
There are many other blocks people are suggesting for variables too!
So i created A MUCH BIGGER topic for you all: containing 7 possible blocks
HERE
it's almost useless to me but it will be super useful to new scratchers so i support
- cooldude-222
-
100+ posts
Variable Positioning
I support the
move [my variable v] to X: () Y: () ::variables