Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Button creation, trigger is in onload()
- function createButtons()
- --Card count displays, get created first so they have index of 0 on their zones
- for i, v in ipairs(objectSets) do
- --local pos = {0,-1.7,3} if i==1 then pos = {0.07,-1.7,-2.865} end
- local cScale = v.z.getScale()
- local dScale = {x=1/cScale.x, y=1/cScale.y, z=1/cScale.z}
- local pos = {0*dScale.x,-1.7*dScale.y,3*dScale.z}
- if i==1 then
- pos = {0.05*dScale.x,-1.7*dScale.y,-2.85*dScale.z}
- end
- local rot = {0,180,0}
- v.z.createButton({
- label="99", click_function="hitCard", function_owner=nil,
- position=pos, rotation=rot, height=500, width=500, font_size=300,
- scale=dScale
- })
- end
- --Pay or clear bet buttons
- for i, v in ipairs(objectSets) do
- local cScale = v.z.getScale()
- local dScale = {x=1/cScale.x, y=1/cScale.y, z=1/cScale.z}
- if i > 1 then
- v.z.createButton({
- label="Clear", click_function="clearBet", function_owner=nil,
- position={1*dScale.x,-1.7*dScale.y,3*dScale.z},
- rotation={0,180,0}, height=400, width=400, font_size=140,
- scale=dScale
- })
- v.z.createButton({
- label="Pay", click_function="payBet", function_owner=nil,
- position={-1*dScale.x,-1.7*dScale.y,3*dScale.z},
- rotation={0,180,0}, height=400, width=400, font_size=140,
- scale=dScale
- })
- end
- end
- --Deal and deck buttons
- cardHandler.createButton({
- label="Deal\nCards", click_function="dealButtonPressed", function_owner=nil,
- position={0,0.19,0}, rotation={0,0,0}, width=450, height=450, font_size=150
- })
- cardHandler.createButton({
- label="New\nDeck", click_function="newDeck", function_owner=nil,
- position={0.9,0.19,0}, rotation={0,0,0}, width=450, height=450, font_size=150
- })
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement