Hi Andre,

I think the alignment code is probably very similar to what you were already considering, but you only need one loop. Try something like this which is a script I used a few days ago to make a group containing 64 fields in an 8 x 8 grid. Each field was 120 wide and 54 high with the top row of fields starting at pixel 44.

on mouseUp
  lock screen
  start editing grp "DataFields"
  repeat with x = 1 to 64
    put "Slot" & x into tF
    if there is not a field tF then
      create fld tF
      -- set properties of the field if required
    end if
    put ((x - 1) div 8) * 120 into tX
    put (((x - 1) mod 8) * 54) + 44 into tY
    set the topLeft of fld tF to (tX & comma & tY)
  end repeat
  stop editing
  beep
end mouseUp

Cheers,
Sarah
[EMAIL PROTECTED]
http://www.troz.net/Rev/

P.S. Thanks for you complimentary email about my revJournal articles.


On 1 Jun 2004, at 10:44 am, Andre Garzia wrote:

Hi Folks,

I want to align buttons by code. I create them in openStack handler and would like Revolution to spread them accross the card like for example a grid. Is there a clever way to do it, or should I use old school method of two loops one setting X axis and the other setting Y axis? Since we can use the property inspector to align objects, I assume that there's some clever way to replicate that by code...

Cheers
andre
--
Andre Alves Garzia  2004
Soap Dog Studios - BRAZIL
http://studio.soapdog.org
_______________________________________________
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution




_______________________________________________ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to