Total Pageviews

Sunday, April 6, 2014

ចង់ Check មើល SystemEvent

System.hasEventSource()
វានឹងត្រឡប់ថាតើ system delivers events ឆ្លើយតបនឹង eventName

Syntax: system.hasEventSource (eventName)

eventName(តំរូវការ) វាជា String ដែលជាឈ្មោះរបស់​​ event source ដែល delivers events នៃឈ្មោះនោះ។ សំរាប់​event source មានឈ្មោះដូចខាងក្រោមះ
តំលៃត្រឹមត្រូវរបស់វាមានះ
Orientation accelerometer gyroscope location heading multitouch collision preCollision postCollision
សូមមើលកូដះ
local has_gyroscrope = system.hasEventSource( "gyroscope" )
if has_gyroscope then
    print( "The device has a gyroscrope." )

end

No comments:

Post a Comment