Thank you Saerothir: but still is not working. Let’s start from the VERY BEGINNING.
All I have is a main.lua file and 1 scene2.lua file.
– main.lua
display.setStatusBar (display.HiddenStatusBar)
local storyboard = require “storyboard”
local widget = require( “widget” )
widget.newButton
{
left = 12,
top = 200,
defaultFile = “button.png”,
overFile = “over.png”,
}
local function onBtn1Release(event)
storyboard.gotoScene( “scene2”, “fade”, 400 )
return true
end
onRelease = onBtn1Release
– scene2.lua
local storyboard = require “storyboard”
local widget = require( “widget” )
local bg = display.newImage (“background1.png”)
And is not working,
ALL THIS LET’S NAT COMPLICATE THINGS
_Now since the icons you want to represent buttons are a part of the background image itself, then just forget these two lines:
default = “default.png”,
over = “over.png”,
and just define the size&location of the button.
Also, be sure to use
.isVisible = false;
.isHitTestable = true;
You’ll just be positioning an invisible rect that will receive touch-events._
I just want to understand the basic concept of going from one place to the other.
All I have is a button, that I created with
widget.newButton
{
left = 12, – LOCATION
top = 200, – THIS IS JUST LOCATION EASY!
defaultFile = “button.png”, – THIS IS JUST THE IMAGE I WANT FOR THE BUTTON
overFile = “over.png”, – I CAN EVEN TAKE THIS OUT, I know what this is for
}
Now I have the button…
I created the function to make the button take me to the other scene
local function onBtn1Release(event)
storyboard.gotoScene( “scene2”, “fade”, 400 )
return true
end
OKAY NOW WHAT? This is my problem
onRelease = onBtn1Release – THIS LINE DOESN’T WORK
do I addEventListener ? - IT DID NOT WORK
or am I missing something on the “scene2.lua” file
local storyboard = require “storyboard” – I JUST HAVE THE STORYBOARD REQUIRE
local widget = require( “widget” ) – THE WIDGET REQUIRE
local bg = display.newImage (“background1.png”) – And I just have a background there, just to make sure I’, in the other place.
Believe me I’m trying, is it SO HARD TO DO THAT?
Victor