i has this prototype storyboard that contains this code
[spoiler]
--prototype.lua local storyboard = require( "storyboard" ) local scene = storyboard.newScene() local Controller = require("scripts.Controller") --local var here --buttons local buttonLeft, buttonRight, buttonUp, buttonDown --groups local buttonGroup -- Called when the scene's view does not exist: function scene:createScene( event ) local group = self.view buttonLeft = Controller.buttonLeft --runtime error:attempt to index upvalue "Controller" (a boolean value) buttonRight = Controller.buttonRight buttonUp = Controller.buttonUp buttonDown = Controller.buttonDown buttonGroup = display.newGroup() buttonGroup:insert(buttonLeft) buttonGroup:insert(buttonRight) buttonGroup:insert(buttonUp) buttonGroup:insert(buttonDown) group:insert(buttonGroup) end --suceeding part of storyboard template didnt change
[/spoiler]
then im putting an arrow touch buttons at the lower left corner of the screen,… here’s the code
[spoiler]
--Controller.lua --arrow buttons local button\_up, button\_down, button\_left, button\_right --variables local defaultAlphaButton defaultAlphaButton = 0.5 function buttonDown() button\_down = display.newImage("Assets/Images/buttonDown.png") button\_down.x = button\_left.contentWidth+button\_down.width/2 button\_down.y = display.contentHeight-button\_down.width/2 button\_down.alpha = defaultAlphaButton return button\_down end function buttonLeft() button\_left = display.newImage("Assets/Images/buttonLeft.png") button\_left.y = display.contentHeight-button\_down.contentHeight-button\_left.height/2 button\_left.alpha = defaultAlphaButton return button\_left end function buttonRight() button\_right = display.newImage("Assets/Images/buttonRight.png") button\_right.x = button\_left.width+button\_down.width+button\_right.width/2 button\_right.y = display.contentHeight-button\_down.contentHeight-button\_right.height/2 button\_right.alpha = defaultAlphaButton return button\_right end function buttonUp() button\_up = display.newImage("Assets/Images/buttonUp.png") button\_up.x = button\_left.width+button\_up.width/2 button\_up.y = display.contentHeight - button\_down.height - button\_left.height - button\_up.height/2 button\_up.alpha = defaultAlphaButton return button\_up end
[/spoiler]
i’ve experiencing error [see the runtime error comment on first code] and cant trace why receiving this problem
btw i also tried commenting the x and y values of each button [probably there is the problem] but still getting the same error, so i guess it is not on the x and y values
thanks in advance
