Hello,
I am trying to make 16 circles appear in an evenly spaced 4x4 grid in the center of the screen, and I need to make this appear similarly on different screens (i.e. it can be larger or smaller, but should always show up as as circles in a square grid, not as ovals in a rectangle grid).
I can accomplish this by setting the canvas aspect ratio to (1,1) but then the rest of my task looks weird.
Therefore I have set the aspect ratio to 4,3, and tried to do the following, which does not display anything.
It looks like what is wrong is that I am trying to give my circles a value in pixels for position and thinks it is a percent (the default), but I could not make my expressions give me a value in pixels.
(e.g. as a test case, /circle_col1_pos = (300px) works, but when i try to include math and the 'px' text in my expression it doesn't work /circle_col1_pos = ((300+1)px)
Any help on how to get this to work would be appreciated.
Thanks!
Thalia
<expressions>
/circle_size = display.canvasheight/30
/circle_row1_pos = ((display.canvasheight/2) + expressions.circle_size*1)
/circle_row2_pos =(display.canvasheight/2) + expressions.circle_size*1
/circle_row3_pos =(display.canvasheight/2) + expressions.circle_size*(-1)
/circle_row4_pos =(display.canvasheight/2) + expressions.circle_size*(-2)
/circle_col1_pos = ((display.canvasheight/2) + expressions.circle_size*2)
/circle_col2_pos =(display.canvasheight/2) + expressions.circle_size*1
/circle_col3_pos =(display.canvasheight/2) + expressions.circle_size*(-1)
/circle_col3_pos =(display.canvasheight/2) + expressions.circle_size*(-2)
</expressions>
<shape circle1>
/ shape = circle
/ size = (expressions.circle_size,expressions.circle_size)
/ position = (expressions.circle_row1_pos,expressions.circle_col1_pos)
/ color = blue
</shape>
(and so on to create circle2, etc)