resizing multiple objects with Lua

Home Forums General Programming resizing multiple objects with Lua

This topic contains 0 replies, has 1 voice, and was last updated by  human fly 10 months ago.

Viewing 1 post (of 1 total)
  • Author
  • #83506

    human fly
    • Topics: 123
    • Replies: 1055
    • Total: 1178
    • ★★★★

    quick share of a little trick discovered this morning
    to save work resizing 96 objects 🙂

    mods called “kb”..(1-96), want to resize them all.
    some are white keys(longer), some are black keys(shorter).
    -want to change white height from 64 to 48, and black 54 to 38.

    function tempheight()
    	for i=1,96 do 
    	local kybd = panel:getComponent("kb"..i)
    	local ksize=tostring(kybd:getProperty("componentRectangle")) 
    	local strgprefx = string.sub(ksize,1,-3)
    	local height=tonumber(string.sub(ksize,-2))
    		if height		==64 then 
    		elseif height	==54 then 
    • This topic was modified 10 months ago by  human fly. Reason: correction
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

There is currently 0 users and 26 guests online
No users are currently active
Forum Statistics
Threads: 2,185, Posts: 15,382, Members: 49,553
Most users ever online was 12 on January 22, 2019 3:47 pm
Do NOT follow this link or you will be banned from the site!