Hi, thanks for your help.
I have no problem with " require “sprite” " line. My “prince” character was initial and play “stand” animation normally.
As your request, here is the code from optionscene
local function buttonOption\_onpress ()
--dispose()
myPrince:turnLeft()
director:changeScene("mainmenuscene","overFromLeft")
end
-- Main function - MUST return a display.newGroup()
function new()
local localGroup = display.newGroup()
-- Background
local background = display.newImage("GFX/background/default.png")
localGroup:insert(background)
myPrince = prince.newPrince();
localGroup:insert(myPrince)
Origin file:
optionscene.lua
[code]
module(…, package.seeall)
require “slider”
local prince = require(“prince”)
local myPrince
local press = function( event )
print( “press” )
end
local release = function( event )
print( “release” )
end
local eventHandler = function( event )
–print( "id = " … event.id … “, phase = " … event.phase … " value=” … event.value )
–[[
if event.value == 100 then
director:changeScene(“mainmenuscene”,“overFromLeft”)
end
]]–
end
local tm = function() print("Texture memory used: " … system.getInfo(“textureMemoryUsed”)) end
local function dispose ()
myPrince:dispose()
end
local function buttonOption_onpress ()
–dispose()
myPrince:turnLeft()
director:changeScene(“mainmenuscene”,“overFromLeft”)
end
– Main function - MUST return a display.newGroup()
function new()
local localGroup = display.newGroup()
– Background
local background = display.newImage(“GFX/background/default.png”)
localGroup:insert(background)
myPrince = prince.newPrince();
localGroup:insert(myPrince)
local buttonOption = ui.newButton{
default = “GFX/mainmenu/buttonover.png”,
over = “GFX/mainmenu/buttondefault.png”,
x = display.contentWidth / 2 - 2,
y = display.contentHeight - 40,
onRelease = buttonOption_onpress,
text = “BACK”,
emboss = true,
textColor = {123, 123, 123, 0}
}
localGroup:insert(buttonOption)
local mySlider = slider.newSlider(
{
track = “GFX/slider/track.png”,
thumbDefault = “GFX/slider/thumb.png”,
thumbOver = “GFX/slider/thumbDrag.png”,
onPress = press,
onRelease = release,
onEvent = eventHandler,
}
)
mySlider.x = display.contentWidth / 2
mySlider.y = display.contentHeight / 2
mySlider.value = 50
localGroup:insert(mySlider)
– MUST return a display.newGroup()
return localGroup
end
[/code] [import]uid: 9190 topic_id: 2976 reply_id: 8563[/import]