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 7 months, 1 week ago.

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

    human fly
    Participant
    • Topics: 123
    • Replies: 1052
    • Total: 1175
    • โ˜…โ˜…โ˜…โ˜…

    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 
    		kybd:setProperty("componentRectangle",(strgprefx.."48"),false)
    		elseif height	==54 then 
    		kybd:setProperty("componentRectangle",(strgprefx.."38"),false)
    		end
    	end
    end
    • This topic was modified 7 months, 1 week 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 29 guests online
No users are currently active
Forum Statistics
Threads: 2,166, Posts: 15,277, Members: 22,167
Most users ever online was 10 on October 29, 2018 2:54 pm
Do NOT follow this link or you will be banned from the site!