Total Pageviews

Thursday, April 17, 2014

composer.setVariable()

composer.setVariable()
នេះជាហ្វាំងសិនដែលប្រើសំរាប់បញ្ចូល variable (within the composer module) ដែលអាច access ចេញពី other scene តាមរយះ composer.getVariable()
Syntax: composer.setVariable (variableName, value)
variableNameវាជា string ដែលជាឈ្មោះរបស់ variable ដែលត្រូវបញ្ចូល
value វាជា string ដែលជាតំលៃក្នុងការ assign ទៅកាន់ Variable

សូមមើលកូដះ
-- Set the Composer variable "money" to 100
composer.setVariable( "money", 100 )
-- In another scene...
local currentMoney = composer.getVariable( "money" )


No comments:

Post a Comment