Hi, i have a picker wheel whose value is snap and fullscreen. I need to call the other LUA file if i select fullscreen or snap but its not working , need help
The act of setting a picker wheel wont trigger anything, You have to have another button that gets the value of the picker wheel and then load your file.
Rob
Hi, Rob I do have a button to trigger the new page but still its not working can anyone share the code ?
I have a picker wheel value of “full screen”,and “snap” on selecting fullscreen and then click on a button event it should displasy me a fullscreen page or if value is snap it should display snap page and there is button on both full screen and snap to go back to the main.lua file.
Can you post the relevant code? Make sure to use the <> in the edit bar to paste your code in.
Rob
------------ main.lua --------------------------
<local widget = require( “widget” )
local storyboard = require (“storyboard”) --syntax
local notifications = require( “plugin.notifications” )
local director = require(“full screen”)
local director= require(“snap”)
–local director = require (“main”)
–display.setStatusBar (display.HiddenStatusBar)
–Objects
local fromhours ={}
local tohours ={}
local hours = {}
local minutesObject = {}
local minutesReminderObject = {}
local datePickerResult = {}
local columnObject = {}
local pickerWheel
local textView
local pickerWheelHeight = 222
–Creating UI
local activeLabel = display.newText(“Active:”, 40,10,native.systemFont, 16)
–local fromText = display.newText(“09:00”, 200, 10, native.systemFont, 16)
local toText = display.newText( “09:00 18:00”, 250, 10, native.systemFont, 16)
local reminderLabel = display.newText(“Reminder:”, 51,40,native.systemFont, 16)
local reminderText = display.newText(“60 mins”, 278,40,native.systemFont, 16)
local reminderTypeLabel = display.newText(“Reminder type”, 67, 75, native.systemFont, 16)
local reminderTypeText = display.newText(“Dialog”, 275, 75, native.systemFont, 16)
– function to move to a specific screen
local function onTestReminderListener(event)
if (ReminderTypeText == “Dialog”) then
director:moveToScene(main, {transitionType=“slideInL”, transitionTime=0.5})
elseif (ReminderTypeText == “full screen”) then
director:moveToScene (fullscreen, {transitionType=“slideInL”, transitionTime=0.5})
elseif (scene_name == “snap”) then
director:moveToScene(snap, {transitionType=“slideInL”, transitionTime=0.5})
end
end
local function onTestReminderListener(event)
print(“onTestReminderListener”)
–local onTestReminderListenerGroup = self.View
–If ReminderTypetext == Full screen then function to move to a specific
–if ReminderTypetext == Dialog then
if ReminderTypedata == Fullscreen then
display.setStatusBar (display.HiddenStatusBar)
local storyboard = require “storyboard”
storyboard.gotoScene ( “Full screen”)
else if
ReminderTypedata == Snap then
display.setStatusBar (display.HiddenStatusBar)
local storyboard = require “storyboard”
storyboard.gotoScene ( “snap”)
–elseif ReminderTypedata == Dialog then
– storyboard.gotoscene (“main”)
end
end
end
–onTestReminderListener:addEventlistener(“tap”,onTestReminderListener)
–return onTestReminderListener
local reminderTypeTestButton = widget.newButton
{
left = -20,
top = 85,
id = “reminderTypeTestButtonId”,
label = “Test reminder”,
onEvent = onTestReminderListener,
labelColor = { default={ 0.5, 1, 1 }, over={ 1, 1, 1, 1 } }
} --[[if ReminderTypedata == Fullscreen then
display.setStatusBar (display.HiddenStatusBar)
local storyboard = require “storyboard”
storyboard.gotoScene ( “Full screen”)
else if
ReminderTypedata == Snap then
display.setStatusBar (display.HiddenStatusBar)
local storyboard = require “storyboard”
storyboard.gotoScene ( “snap”)
elseif ReminderTypedata == Dialog then
storyboard.gotoscene (“main”)
end
end]]
for f= 1, 10 do
fromhours[f]= f
end
--Populate the “to time” table
for t=1, 10 do
tohours[t]= t
end
for y = 0, 59 do
if y < 10
then minutesObject[y] = “0”…y - 1
else
minutesObject[y] = y - 1
end
end
for y = 1, 60 do
if y < 10
then minutesReminderObject[y] = “0”…y
else
minutesReminderObject[y] = y
end
end
–local timeData =
–{
–Hours
–{
– align=“right”,
– width=100,
– startIndex = 1,
– labels = hours
–},
– Minutes
–{
– align=“right”,
– widget=100,
– startIndex = 1,
– labels = minutesObject
–},
–AM/PM
–{
– align=“right”,
– width=100,
– startIndex=1,
– labels={“AM”, “PM”}
–}
–}
–local columnData = \
local timeData =
{
--From Hours
{
align=“left”,
width = 150,
startIndex= 5,
labels = {“09:00”,“10:00”,“11:00”,“12:00”,“13:00”,“14:00”,“15:00”,“16:00”,“17:00”,“18:00”}
},
– To Hours
{
align=“right”,
width = 100,
startIndex= 8,
labels = {“09:00”,“10:00”,“11:00”,“12:00”,“13:00”,“14:00”,“15:00”,“16:00”,“17:00”,“18:00”}
}
}
local reminderData =
{
–Time in minutes
{
align=“center”,
width=150,
startIndex = 1,
labels = minutesReminderObject
},
{
align=“center”,
width=200,
startIndex = 1,
labels = {“min”}
}
}
local reminderTypeData =
{
–Time in minutes
{
align=“center”,
width=300,
startIndex = 1,
labels = {“Dialog”, “Full screen”, “Snap”}
–onPress = call test reminder
}
}
–[[local function onPickerWheelListenerFrom(event)
local values = pickerWheel:getValues()
local hourResult = values[1].value
local minResult = values[2].value
pickerWheel.isVisible = false
fromText.text = hourResult … “:” …minResult
end]]
–local function onPickerWheelListenerTo(event)
local function onPickerWheelListenerFrom(event)
local values = pickerWheel:getValues()
local hourResult = values[1].value
local minResult = values[2].value
pickerWheel.isVisible = false
toText.text = hourResult … " " …minResult
end
local function onPickerWheelListenerReminder(event)
local values = pickerWheel:getValues()
local minResult = values[1].value
local mins = values[2].value
pickerWheel.isVisible = false
local zero = string.sub(minResult, 1,1)
if zero == “0”
then
local result = string.sub(minResult, 2,2)
reminderText.text = result … " " …“min”
else
reminderText.text = minResult … " " …mins
end
end
local function onPickerWheelListenerReminderType(event)
local values = pickerWheel:getValues()
local rType = values[1].value
pickerWheel.isVisible = false
reminderTypeText.text = rType
end
local function onShowPickerFrom(event)
pickerWheel = widget.newPickerWheel
{
top = display.contentHeight - pickerWheelHeight,
columns = timeData
}
pickerWheel:addEventListener(“tap”, onPickerWheelListenerFrom)
end
local function onShowPickerTo(event)
pickerWheel = widget.newPickerWheel
{
top = display.contentHeight - pickerWheelHeight,
columns = timeData
}
pickerWheel:addEventListener(“tap”, onPickerWheelListenerFrom)–onPickerWheelListenerTo)
end
local function onShowPickerReminder(event)
pickerWheel = widget.newPickerWheel
{
top = display.contentHeight - pickerWheelHeight,
columns = reminderData
}
pickerWheel:addEventListener(“tap”, onPickerWheelListenerReminder)
end
local function onShowPickerReminderType(event)
pickerWheel = widget.newPickerWheel
{
top = display.contentHeight - pickerWheelHeight,
columns = reminderTypeData
}
pickerWheel:addEventListener(“tap”, onPickerWheelListenerReminderType)
end
–fromText:addEventListener(“tap”, onShowPickerFrom)
toText:addEventListener(“tap”, onShowPickerTo)
reminderText:addEventListener(“tap”, onShowPickerReminder)
reminderTypeText:addEventListener(“tap”, onShowPickerReminderType)
–Runtime:addEventListener( “location”, function(e)
– local lat = e.latitude
--local lon = e.longitude
– print(lat…","…lon)
–end )
–display.setStatusBar( display.HiddenStatusBar ) – hide the status bar
–local storyboard = require “storyboard” – you need to have this storyboard thing
–storyboard.gotoScene( “working2” )
–[[local function onPickerWheelListenerReminderType(event)
if ReminderTypeText == Fullscreen then
display.setStatusBar (display.HiddenStatusBar)
local storyboard = require “storyboard”
storyboard.gotoScene( “Full screen”,{effect = “fade” , time = 400})
elseif ReminderTypetext == Snap then
display.setStatusBar (display.HiddenStatusBar)
local storyboard = require “storyboard”
storyboard.gotoScene( “snap”,{effect = “fade” , time = 400} )
end
end]]
–>
------------------------fullscreen .lua ---------------------------
<local composer = require(“composer”)
local storyboard = require (“storyboard”) —it needs storyboard all time
local widget = require (“widget”)
local scene = storyboard.newScene() --this line is used to create a new scene or new page
local function returnHome()
storyboard.gotoScene( “snap”, “crossFade”, 1000 )
storyboard.loadScene( “main”,true,“crossFade”,1000)
–scene:destroyScene()
return true
– body
end
– create a scene
function scene:createScene( event )
–print(“Scene:createScene full screen”)
local group = self.view
–local background = display.newImage (“squid1.jpg”,130,200)
local img = display.newImage (“squid1.jpg”,130,200)
–local background = display.newText (“Sepiida says :”,140,290,native.systemFont, 20)
local sepiidaTxt = display.newText (“Sepiida says :”,140,290,native.systemFont, 20)
–local background = display.newText (“Re-Hydration time!”,150,350,native.systemFont, 28)
local msgReminder = display.newText (“Re-Hydration time!”,150,350,native.systemFont, 28)
–bgImage = display.newImage (“squid2.jpg”,0,0)
local buttonHome = widget.newButton
{
left =50,
top = 285,
id= “buttonHomebuttonId”,
onRelease = returnHome,
label = “Thank you”,
labelColor = { default={ 0.5, 1, 1 }, over={ 1, 1, 1, 1 } }
}
buttonHome.x = 150–522
buttonHome.y = 450–655
--group:insert(bgImage)
group:insert (img)–background)
group:insert (buttonHome)
group:insert(sepiidaTxt)
group:insert(msgReminder)
– body
end
function onBackgroundTouch(event)
storyboard.gotoScene(“snap”,“fade”,200)
end
– enter a scene
function scene:enterScene( event)
–bgImage:addEventListener(“touch”,onBackgroundTouch)
local group = self.view
end
– Exit a Scene
function scene:exitScene(event)
local group = self.view
end
– hide a scene
--function scene : hide (event)
–local group = Self.view
–if phase == “will” then
– buttonHome.stop()
– img.cancel
– Sepiida.cancel
– msgReminder.cancel
– elseif phase == “did” then
– display.remove(buttonHome)
– end
– end
– Destroy a scene
function scene:DestroyScene (event)
local group = Self.view
if buttonHome then
buttonHome:removeSelf()
buttonHome = nil
display.remove(sepiidaTxt)
sepiidatxt = nil
display.remove(msgReminder)
msgReminder = nil
end
end
scene:addEventListener(“onBackgroundTouch”,scene)
scene:addEventListener(“hideimage” ,scene)
scene:addEventListener(“createScene”,scene)
scene:addEventListener(“enterScene”,scene)
scene:addEventListener(“exitScene”,scene)
scene:addEventListener(“destroyScene”,scene)
return scene>
--------------Snap----------------------------
<local storyboard = require (“storyboard”) —it needs storyboard all time
local widget = require “widget”
local scene = storyboard.newScene() --this line is used to create a new scene or new page
local function returnHome()
–storyboard.gotoScene(“Snap”,“crossFade”, 1000)
storyboard.loadScene( “main”,true,“crossFade”,1000)
– body
end
– create a scene
function scene:createScene( event )
local group = self.view
local background = display . newImage (“squid1.jpg”)
local background = display.newText (“Sepiida says :”,100,50,native.systemFont, 18)
local background = display.newText (“It is time for another glass of water!”,150,70,native.systemFont, 18)
local buttonHome = widget.newButton {
left =50,
top = 285,
id= “buttonHomebuttonId”,
onRelease = returnHome,
label = “Thank you”,
labelColor = { default={ 0.5, 1, 1 }, over={ 1, 1, 1, 1 } }
}
buttonHome.x = display.contentCenterX --522
buttonHome.y = display.contentCenterX–655
group:insert (background)
group:insert (buttonHome)
– body
end
local function onBackgroundTouch()
storyboard.gotoScene (“Full screen”, {effect “zoomInout”,time=800} )
end
– enter a scene
function scene:enterScene( event)
local group = self.view
end
– Exit a Scene
function scene:exitScene(event)
local group = self.view
end
– Destroy a scene
function scene:DestroyScene (event)
local group = Self.view
if buttonHome then
buttonHome:removeSelf()
buttonHome = nil
end
end
scene:addEventListener(“createScene”,scene)
scene:addEventListener(“enterScene”,scene)
scene:addEventListener(“exitScene”,scene)
scene:addEventListener(“destroyScene”,scene)
return scene
–
–local widget = require (“widget”)
–local text = display. newText(“Sepiida says”,100,50)
–local text1= display. newText("It is time for another glass of water ",140,100)
–local background = display.newImage(“Chrysanthemum.jpg”)
–local reminderTypeTestButton = widget.newButton
–{
– left = 80,
--top = 250,
--id = “OK button to exit the screen”,
--label = “OK”,
--onEvent = onTestReminderListener,
–labelColor = { default={ 0.5, 1, 1 }, over={ 1, 1, 1, 1 } }
–}
–Text properties
–text.x = 10
–text.y = 50
–text1.x = 50
–text1.y =100
>
Hi Rob, i have pasted all my 3 files main.lua,fullscreen.lua,snap.lua
its okay i found a solution u just need to insert "storyboard.removeScene(“snap”) " in ur snap screen to go back to main screen
We don’t need to see your whole code, just the relevant parts. Also next time, click on the <> button in the row in the forum editor that has Bold, Italics, etc. and paste your code into the window that shows up. The community won’t take the time to read unformatted long code.
Sounds like you’ve solved this issue, but next time, help us help you by following these basic forum etiquette items.
Rob
The act of setting a picker wheel wont trigger anything, You have to have another button that gets the value of the picker wheel and then load your file.
Rob
Hi, Rob I do have a button to trigger the new page but still its not working can anyone share the code ?
I have a picker wheel value of “full screen”,and “snap” on selecting fullscreen and then click on a button event it should displasy me a fullscreen page or if value is snap it should display snap page and there is button on both full screen and snap to go back to the main.lua file.
Can you post the relevant code? Make sure to use the <> in the edit bar to paste your code in.
Rob
------------ main.lua --------------------------
<local widget = require( “widget” )
local storyboard = require (“storyboard”) --syntax
local notifications = require( “plugin.notifications” )
local director = require(“full screen”)
local director= require(“snap”)
–local director = require (“main”)
–display.setStatusBar (display.HiddenStatusBar)
–Objects
local fromhours ={}
local tohours ={}
local hours = {}
local minutesObject = {}
local minutesReminderObject = {}
local datePickerResult = {}
local columnObject = {}
local pickerWheel
local textView
local pickerWheelHeight = 222
–Creating UI
local activeLabel = display.newText(“Active:”, 40,10,native.systemFont, 16)
–local fromText = display.newText(“09:00”, 200, 10, native.systemFont, 16)
local toText = display.newText( “09:00 18:00”, 250, 10, native.systemFont, 16)
local reminderLabel = display.newText(“Reminder:”, 51,40,native.systemFont, 16)
local reminderText = display.newText(“60 mins”, 278,40,native.systemFont, 16)
local reminderTypeLabel = display.newText(“Reminder type”, 67, 75, native.systemFont, 16)
local reminderTypeText = display.newText(“Dialog”, 275, 75, native.systemFont, 16)
– function to move to a specific screen
local function onTestReminderListener(event)
if (ReminderTypeText == “Dialog”) then
director:moveToScene(main, {transitionType=“slideInL”, transitionTime=0.5})
elseif (ReminderTypeText == “full screen”) then
director:moveToScene (fullscreen, {transitionType=“slideInL”, transitionTime=0.5})
elseif (scene_name == “snap”) then
director:moveToScene(snap, {transitionType=“slideInL”, transitionTime=0.5})
end
end
local function onTestReminderListener(event)
print(“onTestReminderListener”)
–local onTestReminderListenerGroup = self.View
–If ReminderTypetext == Full screen then function to move to a specific
–if ReminderTypetext == Dialog then
if ReminderTypedata == Fullscreen then
display.setStatusBar (display.HiddenStatusBar)
local storyboard = require “storyboard”
storyboard.gotoScene ( “Full screen”)
else if
ReminderTypedata == Snap then
display.setStatusBar (display.HiddenStatusBar)
local storyboard = require “storyboard”
storyboard.gotoScene ( “snap”)
–elseif ReminderTypedata == Dialog then
– storyboard.gotoscene (“main”)
end
end
end
–onTestReminderListener:addEventlistener(“tap”,onTestReminderListener)
–return onTestReminderListener
local reminderTypeTestButton = widget.newButton
{
left = -20,
top = 85,
id = “reminderTypeTestButtonId”,
label = “Test reminder”,
onEvent = onTestReminderListener,
labelColor = { default={ 0.5, 1, 1 }, over={ 1, 1, 1, 1 } }
} --[[if ReminderTypedata == Fullscreen then
display.setStatusBar (display.HiddenStatusBar)
local storyboard = require “storyboard”
storyboard.gotoScene ( “Full screen”)
else if
ReminderTypedata == Snap then
display.setStatusBar (display.HiddenStatusBar)
local storyboard = require “storyboard”
storyboard.gotoScene ( “snap”)
elseif ReminderTypedata == Dialog then
storyboard.gotoscene (“main”)
end
end]]
for f= 1, 10 do
fromhours[f]= f
end
--Populate the “to time” table
for t=1, 10 do
tohours[t]= t
end
for y = 0, 59 do
if y < 10
then minutesObject[y] = “0”…y - 1
else
minutesObject[y] = y - 1
end
end
for y = 1, 60 do
if y < 10
then minutesReminderObject[y] = “0”…y
else
minutesReminderObject[y] = y
end
end
–local timeData =
–{
–Hours
–{
– align=“right”,
– width=100,
– startIndex = 1,
– labels = hours
–},
– Minutes
–{
– align=“right”,
– widget=100,
– startIndex = 1,
– labels = minutesObject
–},
–AM/PM
–{
– align=“right”,
– width=100,
– startIndex=1,
– labels={“AM”, “PM”}
–}
–}
–local columnData = \
local timeData =
{
--From Hours
{
align=“left”,
width = 150,
startIndex= 5,
labels = {“09:00”,“10:00”,“11:00”,“12:00”,“13:00”,“14:00”,“15:00”,“16:00”,“17:00”,“18:00”}
},
– To Hours
{
align=“right”,
width = 100,
startIndex= 8,
labels = {“09:00”,“10:00”,“11:00”,“12:00”,“13:00”,“14:00”,“15:00”,“16:00”,“17:00”,“18:00”}
}
}
local reminderData =
{
–Time in minutes
{
align=“center”,
width=150,
startIndex = 1,
labels = minutesReminderObject
},
{
align=“center”,
width=200,
startIndex = 1,
labels = {“min”}
}
}
local reminderTypeData =
{
–Time in minutes
{
align=“center”,
width=300,
startIndex = 1,
labels = {“Dialog”, “Full screen”, “Snap”}
–onPress = call test reminder
}
}
–[[local function onPickerWheelListenerFrom(event)
local values = pickerWheel:getValues()
local hourResult = values[1].value
local minResult = values[2].value
pickerWheel.isVisible = false
fromText.text = hourResult … “:” …minResult
end]]
–local function onPickerWheelListenerTo(event)
local function onPickerWheelListenerFrom(event)
local values = pickerWheel:getValues()
local hourResult = values[1].value
local minResult = values[2].value
pickerWheel.isVisible = false
toText.text = hourResult … " " …minResult
end
local function onPickerWheelListenerReminder(event)
local values = pickerWheel:getValues()
local minResult = values[1].value
local mins = values[2].value
pickerWheel.isVisible = false
local zero = string.sub(minResult, 1,1)
if zero == “0”
then
local result = string.sub(minResult, 2,2)
reminderText.text = result … " " …“min”
else
reminderText.text = minResult … " " …mins
end
end
local function onPickerWheelListenerReminderType(event)
local values = pickerWheel:getValues()
local rType = values[1].value
pickerWheel.isVisible = false
reminderTypeText.text = rType
end
local function onShowPickerFrom(event)
pickerWheel = widget.newPickerWheel
{
top = display.contentHeight - pickerWheelHeight,
columns = timeData
}
pickerWheel:addEventListener(“tap”, onPickerWheelListenerFrom)
end
local function onShowPickerTo(event)
pickerWheel = widget.newPickerWheel
{
top = display.contentHeight - pickerWheelHeight,
columns = timeData
}
pickerWheel:addEventListener(“tap”, onPickerWheelListenerFrom)–onPickerWheelListenerTo)
end
local function onShowPickerReminder(event)
pickerWheel = widget.newPickerWheel
{
top = display.contentHeight - pickerWheelHeight,
columns = reminderData
}
pickerWheel:addEventListener(“tap”, onPickerWheelListenerReminder)
end
local function onShowPickerReminderType(event)
pickerWheel = widget.newPickerWheel
{
top = display.contentHeight - pickerWheelHeight,
columns = reminderTypeData
}
pickerWheel:addEventListener(“tap”, onPickerWheelListenerReminderType)
end
–fromText:addEventListener(“tap”, onShowPickerFrom)
toText:addEventListener(“tap”, onShowPickerTo)
reminderText:addEventListener(“tap”, onShowPickerReminder)
reminderTypeText:addEventListener(“tap”, onShowPickerReminderType)
–Runtime:addEventListener( “location”, function(e)
– local lat = e.latitude
--local lon = e.longitude
– print(lat…","…lon)
–end )
–display.setStatusBar( display.HiddenStatusBar ) – hide the status bar
–local storyboard = require “storyboard” – you need to have this storyboard thing
–storyboard.gotoScene( “working2” )
–[[local function onPickerWheelListenerReminderType(event)
if ReminderTypeText == Fullscreen then
display.setStatusBar (display.HiddenStatusBar)
local storyboard = require “storyboard”
storyboard.gotoScene( “Full screen”,{effect = “fade” , time = 400})
elseif ReminderTypetext == Snap then
display.setStatusBar (display.HiddenStatusBar)
local storyboard = require “storyboard”
storyboard.gotoScene( “snap”,{effect = “fade” , time = 400} )
end
end]]
–>
------------------------fullscreen .lua ---------------------------
<local composer = require(“composer”)
local storyboard = require (“storyboard”) —it needs storyboard all time
local widget = require (“widget”)
local scene = storyboard.newScene() --this line is used to create a new scene or new page
local function returnHome()
storyboard.gotoScene( “snap”, “crossFade”, 1000 )
storyboard.loadScene( “main”,true,“crossFade”,1000)
–scene:destroyScene()
return true
– body
end
– create a scene
function scene:createScene( event )
–print(“Scene:createScene full screen”)
local group = self.view
–local background = display.newImage (“squid1.jpg”,130,200)
local img = display.newImage (“squid1.jpg”,130,200)
–local background = display.newText (“Sepiida says :”,140,290,native.systemFont, 20)
local sepiidaTxt = display.newText (“Sepiida says :”,140,290,native.systemFont, 20)
–local background = display.newText (“Re-Hydration time!”,150,350,native.systemFont, 28)
local msgReminder = display.newText (“Re-Hydration time!”,150,350,native.systemFont, 28)
–bgImage = display.newImage (“squid2.jpg”,0,0)
local buttonHome = widget.newButton
{
left =50,
top = 285,
id= “buttonHomebuttonId”,
onRelease = returnHome,
label = “Thank you”,
labelColor = { default={ 0.5, 1, 1 }, over={ 1, 1, 1, 1 } }
}
buttonHome.x = 150–522
buttonHome.y = 450–655
--group:insert(bgImage)
group:insert (img)–background)
group:insert (buttonHome)
group:insert(sepiidaTxt)
group:insert(msgReminder)
– body
end
function onBackgroundTouch(event)
storyboard.gotoScene(“snap”,“fade”,200)
end
– enter a scene
function scene:enterScene( event)
–bgImage:addEventListener(“touch”,onBackgroundTouch)
local group = self.view
end
– Exit a Scene
function scene:exitScene(event)
local group = self.view
end
– hide a scene
--function scene : hide (event)
–local group = Self.view
–if phase == “will” then
– buttonHome.stop()
– img.cancel
– Sepiida.cancel
– msgReminder.cancel
– elseif phase == “did” then
– display.remove(buttonHome)
– end
– end
– Destroy a scene
function scene:DestroyScene (event)
local group = Self.view
if buttonHome then
buttonHome:removeSelf()
buttonHome = nil
display.remove(sepiidaTxt)
sepiidatxt = nil
display.remove(msgReminder)
msgReminder = nil
end
end
scene:addEventListener(“onBackgroundTouch”,scene)
scene:addEventListener(“hideimage” ,scene)
scene:addEventListener(“createScene”,scene)
scene:addEventListener(“enterScene”,scene)
scene:addEventListener(“exitScene”,scene)
scene:addEventListener(“destroyScene”,scene)
return scene>
--------------Snap----------------------------
<local storyboard = require (“storyboard”) —it needs storyboard all time
local widget = require “widget”
local scene = storyboard.newScene() --this line is used to create a new scene or new page
local function returnHome()
–storyboard.gotoScene(“Snap”,“crossFade”, 1000)
storyboard.loadScene( “main”,true,“crossFade”,1000)
– body
end
– create a scene
function scene:createScene( event )
local group = self.view
local background = display . newImage (“squid1.jpg”)
local background = display.newText (“Sepiida says :”,100,50,native.systemFont, 18)
local background = display.newText (“It is time for another glass of water!”,150,70,native.systemFont, 18)
local buttonHome = widget.newButton {
left =50,
top = 285,
id= “buttonHomebuttonId”,
onRelease = returnHome,
label = “Thank you”,
labelColor = { default={ 0.5, 1, 1 }, over={ 1, 1, 1, 1 } }
}
buttonHome.x = display.contentCenterX --522
buttonHome.y = display.contentCenterX–655
group:insert (background)
group:insert (buttonHome)
– body
end
local function onBackgroundTouch()
storyboard.gotoScene (“Full screen”, {effect “zoomInout”,time=800} )
end
– enter a scene
function scene:enterScene( event)
local group = self.view
end
– Exit a Scene
function scene:exitScene(event)
local group = self.view
end
– Destroy a scene
function scene:DestroyScene (event)
local group = Self.view
if buttonHome then
buttonHome:removeSelf()
buttonHome = nil
end
end
scene:addEventListener(“createScene”,scene)
scene:addEventListener(“enterScene”,scene)
scene:addEventListener(“exitScene”,scene)
scene:addEventListener(“destroyScene”,scene)
return scene
–
–local widget = require (“widget”)
–local text = display. newText(“Sepiida says”,100,50)
–local text1= display. newText("It is time for another glass of water ",140,100)
–local background = display.newImage(“Chrysanthemum.jpg”)
–local reminderTypeTestButton = widget.newButton
–{
– left = 80,
--top = 250,
--id = “OK button to exit the screen”,
--label = “OK”,
--onEvent = onTestReminderListener,
–labelColor = { default={ 0.5, 1, 1 }, over={ 1, 1, 1, 1 } }
–}
–Text properties
–text.x = 10
–text.y = 50
–text1.x = 50
–text1.y =100
>
Hi Rob, i have pasted all my 3 files main.lua,fullscreen.lua,snap.lua
its okay i found a solution u just need to insert "storyboard.removeScene(“snap”) " in ur snap screen to go back to main screen
We don’t need to see your whole code, just the relevant parts. Also next time, click on the <> button in the row in the forum editor that has Bold, Italics, etc. and paste your code into the window that shows up. The community won’t take the time to read unformatted long code.
Sounds like you’ve solved this issue, but next time, help us help you by following these basic forum etiquette items.
Rob