Total Pageviews
Tuesday, March 18, 2014
ចុះចំណែក function របស់ Display មានអ្វីខ្លះ?
១. Display.capture()
ហ្វាំងសិនមួយនេះមានតួនាទីដូចជា display.save() ភាពខុសគ្នារបស់វាគឺ នឹង Returns a display object ជំនួសការ Save ៕ វាអាចបន្ថែម Option ក្នុងការ Save the capture ទៅ Photo Lib របស់ Devices ដែលត្រូវ ធ្វើវានៅក្នុងការហៅហ្វាំងសិន។
Display.capture() អាចជា Hybrid នៅចន្លោះ display.save() & display.captureScreen()
ចំណាំះ
Adroid: នៅពេលដែល App របស់អ្នកត្រូវ Suspended ពេលនោះ Android OS លុបចេញគ្រប់ទាំង OpenGL textures ចេញពី Memory។ នៅពេលដែល App ត្រូវ Resumed ពេលនោះ Corona នឹង Load គ្រប់ទាំងរូបភាព ប៉ុន្តែ Capture image មិនមាននៅក្នុង Memory ទៀតទេ។ ដំណោះស្រាយមានដូចនេះ
១. Save the returned capture image to file via the display.save() function
២. Display the image saved to file via display.newImageRect() ដោយប្រើប្រាស់ Capture Object’s Bounds
សូមប្រយ័ត្នះ មិនអាចប្រើ ហ្វាំងសិន display.save() នៅក្នុង Android application Suspend and applicationExit events ពីព្រោះមិនមាន OpenGL texture នៅក្នុង Memory។
សំរាប់ Android ត្រូវការដាក់ Permission នៅក្នុង build.setting ដោយបន្ថែមកូដដូចខាងក្រោម
settings =
{
android =
{
usesPermissions =
{
"android.permission.WRITE_EXTERNAL_STORAGE",
},
},
}
សំរាប់ Mac
ដោយ save screen capture ជាហ្វាល JPEG ទៅកាន់ Current User’s Desktop
សំរាប់ Windows
ដោយ save screen capture ជាហ្វាល png ទៅកាន់ My Pictures\Corona Simulator directory
ដាក់ Capture on Launch
ការប្រើប្រាស់មួយនេះសំរាប់ Display Object នៅលើ Application (នៅពេល main.lua នឹងដំណើរការនៅពេលដែលចាប់ផ្តើម App) ដូចនេះត្រូវប្រើ display.capture() នៅចន្លោះ timer.performWithDelay ។ សំរាប់ delay ត្រូវប្រើត្រឹមតែ 100 វិនាទី
សូមមើលកូដះ
local myObject1 = display.newRect( 50, 50, 100, 150 )
local function captureWithDelay()
local capture = display.capture( myObject1 )
end
timer.performWithDelay( 100, captureWithDelay )
Syntax: display.capture (displayObject, options)
displayObject (តំរូវការ) វាជា Variable ដែលជា References ទៅកាន់ Display object/ group to save
ការដាក់ Object ទាំងអស់នៅក្នុង Group
ប្រើសំរាប់ បង្កើត Group ដែលអាចបន្ថែម ឬលុបចោលនៅ Child Display Objects។ ចាប់ផ្តើមវាគ្មាន Children នៅក្នុង Group ទេ។ កន្លែងដើមរបស់វាគឺ នៅ Parent’s Origin ហើយ anchor របស់វាគឺចាប់ ផ្តើមនៅកន្លែងមួយ។
ចំណាំះ ការប្រើប្រាស់ Groups ជាមួយនឹង Physics engine មានដែលកំនត់។
Syntax: display.newGroup()
សូមមើលកូដះ
បង្កើត rectangle & a group បន្ទាប់មកដាក់ rectangle ទៅក្នុង Group
local rect = display.newRect (20,50,100,100)
rect:setFillColor (0.5)
local group = display.newGroup()
group:insert (rect)
Monday, March 17, 2014
Display.contentScaleX Vs display.contentScaleY
វាជា Ratio ដែលនៅចន្លោះ Content Pixel & Screen Pixel width។ តំលៃរបស់វាតែងតែ ១ អ្នកអាចកែប្រែបានតាមរយះ config.lua ដែលបញ្ជាក់អំពី content’s height & width។ វាមាន Mood ផ្សេងៗទៀតដូចជា “letterbox” “zoomEven” ដែលជាលទ្ធផលនៃ Scale ដែលខុសគ្នា។
សូមមើលកូដះ
Config.lua
application =
{
content =
{
width = 320,
height = 480,
scale = "letterbox"
},
}
Main.lua
local scalex = display.contentScaleX
local scaley = display.contentScaleY
-- display scale values
print( "scaleX", scalex )
print( "scaleY", scaley )
-- OUTPUT:
-- iPhone 4
-- scaleX 0.5
-- scaleY 0.5
-- iPad 1/2
-- scaleX 0.46875
-- scaleY 0.46875
ចង់ដឹងអំពី ប្រវែង Width & Height គិតជា pixel ដូចនេះការប្រើ display ពិតជាអាចជួយបាន។ មើលការប្រើប្រាស់ Print statement ដូចនេះ
Print (display.pixelWidth .. display.pixelHeight)
ការប្រើ (..concat) សំរាប់ភ្ជាប់ Print statement ទាំងពីរនេះ។ មានន័យថា អ្នកអាចដឹងអំពី Smart Devices របស់អ្នកមានប៉ុន្មាន pixel?
Display.screenOriginX / Y តើវាមានប្រយោជន៏អ្វីខ្លះ? វានឹងត្រឡប់មកនៅ x distance ពីខាងឆ្វេង មកដល់ content area។ ដូចជានៅក្នុង “letterbox” & “zoomEven” របស់ Mood៕ វាប្រើសំរាប់បន្ថែម ឬក៏ កាត់ចេញពី Current Device។ អត្ថប្រយោជន៏មួយទៀតគឺ អោយរកឃើញ Visible area ដែលត្រូវ បន្ថែម ឬ លុបចេញពី Current device។
សូមមើលកូដះ
-- Create a grey background
local background = display.newRect( 0, 0, 320, 480 )
background:setFillColor( 0.5 )
-- Create two squares
local rect1 = display.newRect( 0, 0, 50, 50 )
local rect2 = display.newRect( 0, 0, 50, 50 )
-- Place the squares along the top edge
-- Offset the second square with display.screenOriginX
rect1.x = 25
rect2.x = 25 + display.screenOriginX
rect1.y = 25
rect2.y = 150
Library Display របស់ Corona SDK
វាមានតួនាទីសំរាប់បង្ហាញអ្វីមួយនៅលើ
Smart
Devices របស់អ្នកប្រើប្រាស់។ វាមាន Properties យ៉ាងសំបូរបែបអាចប្រើតាមតំរូវការបានយ៉ាងងាយ។ ចូរមើល Properties របស់វាតាមលំដាប់លំដោយះ
Display.actualContentHeight
Vs Display.actualContentWidth (កំពស់ & បណ្តោយ) វាមានតួនាទីសំរាប់បង្ហាញ Height
របស់ Corona នៅក្នុងអេក្រង។
លទ្ធផលអាស្រ័យទៅលើ Scale ដែលត្រូវបន្ថែមកូដនៅក្នុង Config.lua
វាមានតួនាទីដូចខាងក្រោមះ
* for zoomEven scale ដែលតំលៃរបស់វាត្រូវនឹង display.viewableContentHeight
* for zoomEven scale ដែលតំលៃរបស់វាត្រូវនឹង display.viewableContentHeight
*
for zoomStretch scale សំរាប់ content height
*
for letterbox scale សំរាប់ content height, រួមទាំង letterbox area។
Code:
(សូម Copy កូដខាងក្រោមរួច ដាក់លើ Editors ណាមួយបន្ទាប់មក à save ជា(main.lua))
_W
= display.contentWidth
_H
= display.contentHeight
local
sync = display.newImage ("sync.png", 225, 255)
sync.x
= _W/2; sync.y = (_H/2) - 200
print(
display.actualContentHeight )
--
adding the text to display the size
local
showHeight = display.newText ("Your smart device Height is: " ..
display.actualContentHeight, 100, 200, native.systemFont, 34)
showHeight:setFillColor
(1,0,0.5)
showHeight.x
= 350; showHeight.y = 500
--adding
the show width of the devices
local
showWidth = display.newText ("Your smart device Width is: " ..
display.actualContentWidth, 100, 200, native.systemFont, 34)
showWidth:setFillColor
(0,0,0.5)
showWidth.x
= 350; showWidth.y = 600
Sunday, March 16, 2014
សាកស្វែងយល់អំពី Display ម្តងមើល
តើអ្នកចង់ Display អ្វីខ្លះនៅលើអេក្រង់ទូរស័ព្ទ? បើអ្នកដឹងអំពីការប្រើប្រាស់ក៏ដូចជាការ ប្រកាស់ ចំពោះការប្រើប្រាស់របស់វា។ ដូចនេះវានឹងបង្ហាញភាពងាយស្រួលក្នុងការសរសេរ Apps របស់អ្នក
Saturday, March 15, 2014
ចូលដល់វគ្គជ្រៅបន្តិច អំពី Analytics
សំរាប់ Corona Analytics Library អនុញ្ញាត់ឪ្យត្រួតពិនិត្យមើលពី Events របស់ Application
វាមាន Functions ដូចខាងក្រោមះ
analytics.init()
analytics.logEvent()
សំរាប់ IOS វា Support IOS v4.1.0
Android v.1.24
មើលលំអិតអំពី
analytics ដោយចាប់ផ្តើម Library
Syntax: analytics.init(apiKey)
apiKey: សំរាប់ API Key ផ្តល់នូវការវិភាគរបស់ Service Provider
សំរាប់ analytics.logEvent() វិញវានឹង Report ដែល Defined ដោយ String Value
Syntax: analytics.logEvent(eventID)
anaylytics.logEvent (eventID, params)
eventID (តំរូវការ)វាជា String ដែលផ្ទុកនូវ ពត័មានដែលអាច logged ជាមួយនឹង analytics service
params (ជំរើស) ជាតំលៃគូររបស់ Table
ការបង្កើត App ដាក់ឪ្យដោយ Free សំរាប់ប្រើប្រាស់ពេលខ្លះត្រូវរកចំនូលវិញដែរ
សាក់ផ្សាយពាណិជ្ជកម្ម ជាមួយនឹងសេវាខ្លះៗរបស់ Corona SDK
នៅក្នុង Corona មាន Ads Library ដែលអាចឪ្យយើងផ្សាយ Ads នៅក្នុងកម្មវិធីរបស់យើង។ សំរាប់ Ads ដូចខាងក្រោមដែលអាចផ្សាយបានះ
inneractive
vungle
InMobi
AdMob
iAds
សំរាប់ Functions របស់វាមានដូចខាងក្រោម
ads.hide()
ads.init()
ads.show()
កំនត់ចំណាំះ ដើម្បីប្រើប្រាស់សេវានេះ ត្រូវបន្ថែមកូដខ្លះនៅក្នុង build.settings
settings =
{
plugins =
{
-- key is the name passed to Lua's 'require()'
["CoronaProvider.ads.inmobi"] =
{
-- required
publisherId = "com.coronalabs",
},
},
}
inneractive
settings =
{
plugins =
{
-- key is the name passed to Lua's 'require()'
["CoronaProvider.ads.inneractive"] =
{
-- required
publisherId = "com.inner-active",
},
},
}
iAds
settings =
{
plugins =
{
-- key is the name passed to Lua's 'require()'
["CoronaProvider.ads.iads"] =
{
-- required
publisherId = "com.coronalabs",
},
},
}
AdMob
settings =
{
plugins =
{
-- key is the name passed to Lua's 'require()'
["CoronaProvider.ads.admob"] =
{
-- required
publisherId = "com.coronalabs",
},
},
}
នៅក្នុង Corona មាន Ads Library ដែលអាចឪ្យយើងផ្សាយ Ads នៅក្នុងកម្មវិធីរបស់យើង។ សំរាប់ Ads ដូចខាងក្រោមដែលអាចផ្សាយបានះ
inneractive
vungle
InMobi
AdMob
iAds
សំរាប់ Functions របស់វាមានដូចខាងក្រោម
ads.hide()
ads.init()
ads.show()
កំនត់ចំណាំះ ដើម្បីប្រើប្រាស់សេវានេះ ត្រូវបន្ថែមកូដខ្លះនៅក្នុង build.settings
settings =
{
plugins =
{
-- key is the name passed to Lua's 'require()'
["CoronaProvider.ads.inmobi"] =
{
-- required
publisherId = "com.coronalabs",
},
},
}
inneractive
settings =
{
plugins =
{
-- key is the name passed to Lua's 'require()'
["CoronaProvider.ads.inneractive"] =
{
-- required
publisherId = "com.inner-active",
},
},
}
iAds
settings =
{
plugins =
{
-- key is the name passed to Lua's 'require()'
["CoronaProvider.ads.iads"] =
{
-- required
publisherId = "com.coronalabs",
},
},
}
AdMob
settings =
{
plugins =
{
-- key is the name passed to Lua's 'require()'
["CoronaProvider.ads.admob"] =
{
-- required
publisherId = "com.coronalabs",
},
},
}
Friday, March 14, 2014
សាកលុប Table មួយចេញមើល
ចុះបើអ្នកចង់លុប Table ណាចេញមួយ។ ដូច្នេះការប្រើប្រាស់នូវ table.remove ពិតជាអាចជួយអ្នកបាន។
វាប្រើសំរាប់លុប ធាតុរបស់ Table ចេញ។
Syntax: table.remove(t)
table.remove(t,pos)
t(តំរូវការ) ជាប្រភេទអារ៉េដែលត្រូវលុបចេញ
pos(ជំរើស) ជាចំនុចដែលត្រូវលុបចេញ។ តំលៃដើមគឺប្រវែងទាំងអស់ដូចនេះ table.remove(t)វានឹងលុបចេញនូវធាតុរបស់ T
វាប្រើសំរាប់លុប ធាតុរបស់ Table ចេញ។
Syntax: table.remove(t)
table.remove(t,pos)
t(តំរូវការ) ជាប្រភេទអារ៉េដែលត្រូវលុបចេញ
pos(ជំរើស) ជាចំនុចដែលត្រូវលុបចេញ។ តំលៃដើមគឺប្រវែងទាំងអស់ដូចនេះ table.remove(t)វានឹងលុបចេញនូវធាតុរបស់ T
ការប្រើ Table.maxn នៅក្នុង ឡូអា
បើអ្នកចង់ឪ្យតំលៃធំបំផុតរបស់ Index នៃ Table វិលត្រឡប់មកតំលៃដើមវិញ
ឬក៏សូន្យ បើសិនជា Table មិនមាន Position numercial
ដើម្បីប្រើប្រាស់ Function នេះត្រូវប្រើ linear traversal នៃ Table ទាំងមូល
Syntax: table.maxn (t)
t(តំរូវការ) ជាអារ៉េដែលត្រូវឆ្លងកាត់ (Traverse)
ឬក៏សូន្យ បើសិនជា Table មិនមាន Position numercial
ដើម្បីប្រើប្រាស់ Function នេះត្រូវប្រើ linear traversal នៃ Table ទាំងមូល
Syntax: table.maxn (t)
t(តំរូវការ) ជាអារ៉េដែលត្រូវឆ្លងកាត់ (Traverse)
សាក់ភ្ជាប់ Table ពីរចូលគ្នា
Table របស់ឡូអា ប្រើដូចជា Array។ វាអាចប្រើជា index ដោយលេខ ឬក៏ អក្សរ, លើកលែងតែ Nil
នៅពេលប្រើប្រាស់ Tables ត្រូវដឹងពីរបៀបប្រើ Lua Tables។
Functions:
Table.concat()ការប្រើ Concatenate ជាធាតុរបស់ Table ដើម្បីបង្កើត String។ គ្រប់ធាតុទាំងអស់ត្រូវប្រើជា Coerced ទៅក្នុង String។ សំរាប់ Seperator អាចត្រូវប្រើឪ្យច្បាស់លាស់នៅចន្លោះ Concatenated elements។
Syntax: table.concat (t)
Syntax: table.concat (t, sep)
Syntax: table.concat (t, sep, i)
Syntax: table.concat (t,sep,I,j)
T (តំរូវភាព) Array: ជា អារ៉េដែលគ្រប់ទាំងធាតុ ជា Strings Or Numbers
Sep (ជំរើស) String: ជាស្រ្ទីង ដែលត្រូវបញ្ចូលនៅចន្លោះ Concatenated table values។ តំលៃដើមគឺទទេ
I (ជំរើស) ជាលេខ នៅពេលចាប់ផ្តើម table index to be concatenated។ តំលៃដើមគឺ១
J (ជំរើស) នៅពេលបញ្ចប់នៅ Table index to be concatenated។ តំលៃដើមគឺ អារ៉េ t បើសិនជាធំជាង J
ត្រឡប់ជា empty string។
Thursday, March 13, 2014
តួនាទីរបស់ Sort Table នៅក្នុងឡូអា
ការចង់ Sort ធាតុរបស់ Table តាមលំដាប់លំដោយ, ដោយចាប់ពី table[1] to table[n] ដែលតំលៃរបស់N ជាប្រវែងរបស់ Table
វានឹងចាប់ផ្តើមយក អារ៉រមក Sort រួមទាំងធ្វើការប្រៀបធៀបទៀត។ បើសិនជាការប្រៀបធៀប នឹងបង្ហាញនៅ Argumentsចំនួនពីរ ហើយវា
បង្ហាញតំលៃពិត តែបើសិនជា First Arguments បង្ហាញមុនដែលចាប់ផ្តើម Sort ដោយអារ៉េ ។ បើសិនជាការ ប្រៀបធៀបមិនបង្ហាញ ពេលនោះ
ឡូអា Operator < ត្រូវបានយកមកប្រើ
Syntax: table.sort(t)
table.sort(t, compare)
t(តំរូវការ) ជាអារ៉េដែលត្រូវ ៃោរត
Compare (ជំរើស) វាជា Function បើសិនជាមិនបង្ហាញ ពេលនោះ Lua Standard Operator < នឹងត្រូវយកមកប្រើ
ចង់បញ្ចូលទិន្នន័យទៅក្នុង Table
សំរាប់ដាក់នៅតំលៃណាមួយទៅក្នុងTable បើសិនជាវាត្រូវបានបញ្ចូលទៅកាន់
តំលៃណាមួយនៅពីមុខតំលៃនោះ
Syntax: table.insert (t, value)
table.insert (t, pos, value)
t(តំរូវការ) ជាអារ៉េ ជាតំលៃដែលនឹងត្រូវបន្ថែម
pos(ជំរើស) ជាលេខដែលនឹង index នៃ Table ដែលតំលៃថ្មីត្រូវបានបន្ថែម។ តំលៃដើមរបស់វាគឺ +1 ដូច្នេះ table.insert (t,x) បញ្ចូលតំលៃ X នៅចុង Table របស់ T
value(តំរូវការ) តំលៃថ្មីដែលត្រូវបញ្ចូលទៅក្នុង Table
index របស់ Table សំរាប់ធ្វើអ្វី?
Table.indexOf()
តើអារ៉េមួយនេះប្រើសំរាប់ធ្វើអ្វី? ជាប្រភេទហ្វាំងសិន
វានឹងវិលត្រឡប់ មកវិញនៅ integer index នៃធាតុរបស់អារ៉េនៅក្នុង
T។ បើសិនជាតំលៃត្រឡប់ជា Nil មិនមែន អារ៉េ។
ការស្វែងរកនឹងទៅតាមរយះប្រវែង របស់អារ៉េទាំងអស់ ដែលកំនត់ដោយ #t ដែល តំលៃរបស់វាមិនត្រូវបានកំនត់បើសិនជាមាន holes។
Syntax:
table.indexOf(t, element)
T(តំរូវការ) ជាអារ៉េដែលត្រូវរក
Element
(តំរូវការ)
គ្រប់ទាំងអស់ដែលជាធាតុនៅក្នុងអារ៉េ
តើTableជាអ្វីនៅក្នុងឡូអា?
Table.copy() ជាប្រភេទ ហ្វាំងសិនវានឹងត្រឡប់មកវិញនៅShallow copy of array ឧះបំណែកមួយរបស់ Array(table) ជាមួយនឹង integer keys។ លេខរបស់ អារ៉េ Variable
ដែលអាចដាក់ Optional arguments។ បើសិនជា Array
has a hole (a nil entry), copying នៅប្រភពអារ៉េ ដែលឈប់នៅ last consecutive item prior
to the hole។
Syntax:
table.copy (t)
Table.copy
(t, ..)
T(តំរូវការ) ជាធាតុរបស់អារ៉េ
Wednesday, March 12, 2014
ចង់មើល Map លើ Devices របស់អ្នកទេ
មាន API របស់ Native មួយនៅក្នុង Corona SDK ដែលអាចមើល Map បានដែរ។ វាប្រើសំរាប់ Render នឹងបន្ទាប់មកបង្ហាញ Object។ វាមិនអាចមើលឃើញនៅក្នុុងកុំព្យូទ័ររបស់អ្នកបានទេ។ សំរាប់ androids ត្រូូវធ្វើការ Config នៅក្នូង build.setting
settings =
{
android =
{
usesPermissions =
{
-- Required by the MapView to fetch its contents from the Google Maps servers.
"android.permission.INTERNET",
-- Optional permission used to display current location via the GPS.
"android.permission.ACCESS_FINE_LOCATION",
-- Optional permission used to display current location via WiFi or cellular service.
"android.permission.ACCESS_COARSE_LOCATION",
},
usesFeatures =
{
-- If you set permissions "ACCESS_FINE_LOCATION" and "ACCESS_COARSE_LOCATION" above,
-- then you may want to set up your app to not require location services as follows.
-- Otherwise, devices that do not have location sevices (such as a GPS) will be unable
-- to purchase this app in the app store.
{ name = "android.hardware.location", required = false },
{ name = "android.hardware.location.gps", required = false },
{ name = "android.hardware.location.network", required = false },
},
},
}
Syntax: native.newMapView( centerX, centerY, width, height )
centerX, centerY: (តំរូវការ) ចំនុចកណ្តាល់ របស់ X,Y របស់ Map
width, height: (តំរូវការ) ជា Width & Height របស់ Map
settings =
{
android =
{
usesPermissions =
{
-- Required by the MapView to fetch its contents from the Google Maps servers.
"android.permission.INTERNET",
-- Optional permission used to display current location via the GPS.
"android.permission.ACCESS_FINE_LOCATION",
-- Optional permission used to display current location via WiFi or cellular service.
"android.permission.ACCESS_COARSE_LOCATION",
},
usesFeatures =
{
-- If you set permissions "ACCESS_FINE_LOCATION" and "ACCESS_COARSE_LOCATION" above,
-- then you may want to set up your app to not require location services as follows.
-- Otherwise, devices that do not have location sevices (such as a GPS) will be unable
-- to purchase this app in the app store.
{ name = "android.hardware.location", required = false },
{ name = "android.hardware.location.gps", required = false },
{ name = "android.hardware.location.network", required = false },
},
},
}
Syntax: native.newMapView( centerX, centerY, width, height )
centerX, centerY: (តំរូវការ) ចំនុចកណ្តាល់ របស់ X,Y របស់ Map
width, height: (តំរូវការ) ជា Width & Height របស់ Map
ស្វែងយល់អំពី Native.newFont()
Native.newFont()សំរាប់ Native មួយនេះប្រើក្នុងការបង្កើត Font
Object ដែលអាចប្រើ
Fonts
ណាមួយដែលនៅក្នុង Native text field & Text Boxes។ វាក៏អាចដាក់ Parameter ក៏បានដោយប្រើ display.newText()
ចំណាំះ
Font
ដែលមានអាស្រ័យទៅលើ Devices
Syntax:
native.newFont (name [, size])
name*:
(តំរូវការ) វាជា String ដែលកំនត់សំគាល់នៅ Font
native.systemFont
native.systemFontBold
Tuesday, March 11, 2014
សូមមើល Native.newWebView នេះតិចមើល
native.newWebView()
សំរាប់ Native មួយនេះប្រើក្នុងការ Loads
នៅ Web Page ពី Remote នៅក្នុង Web View Container។ សំរាប់ Native
មួយនេះខុសពី Native.webPopUp ដែលអាច បំលាស់ទីរបស់វាបាន x/y
properties, rotate them (via the rotation property) ឬដាក់ physics
bodies ហើយនឹង Display Object ផ្សេងៗទៀតបាន។
វា Support នៅ Loading ពី local
file ដែលផ្ទុក HTML ឬក៏ពី remote
website។
Syntax:
native.newWebView( centerX, centerY, width, height )
centerX,
centerY (តំរូវការ) ជាចំនុចកណ្តលរបស់ x
& y របស់ Web View
width
& height (តំរូវការ) ជា Width
& Height របស់ Web View (គិតជា
Pixel)
ចំនាំះ អ្នកមិនអាច View វានៅលើ កុំព្យូទ័របានទេ
ដំណឹងរីករាយ Corona SDK release 2014.2189
សំរាប់អស់អ្នក Developers ទាំងអស់ដែលប្រើ Corona SDK សូម Download Version ចុងក្រោយរបស់ SDK នេះ តាមរយះ Link ខាងក្រោមះ
http://coronalabs.com/
Monday, March 10, 2014
ការប្រើប្រាស់ Native.showWebPopUp
ការប្រើប្រាស់ Native មួយនេះសំរាប់បង្កើត Web PopUp ដែល Load local Web ឬក៏ Remote WebPage
វាអាចដំណើរការតែក្នុង Mac OS X Simulator ហើយនឹង Device ដែលត្រូូវ Build។ មានតែ Web PopUp ដែលនឹងបង្ហាញបានតែម្តង។ សំរាប់ Android ត្រូូវការ Add Permission នៅក្នង "build.setting"
ដែលមានទំរង់ដូចនេះ
settings =
{
android =
{
usesPermissions =
{
"android.permission.INTERNET",
},
},
}
Syntax: native.showWebPopup( url [, options] )
native.showWebPopup( x, y, width, height, url [, options] )
url* = ជា URL Address របស់ Web
x,y,width,height = វាប្រើសំរាប់គ្រប់គ្រង់ Position & Dimension របស់ Web
option* (ជាជំរើស) = ប្រើសំរាប់បន្ថែម Parameters សំរាប់ PopUp
វាអាចដំណើរការតែក្នុង Mac OS X Simulator ហើយនឹង Device ដែលត្រូូវ Build។ មានតែ Web PopUp ដែលនឹងបង្ហាញបានតែម្តង។ សំរាប់ Android ត្រូូវការ Add Permission នៅក្នង "build.setting"
ដែលមានទំរង់ដូចនេះ
settings =
{
android =
{
usesPermissions =
{
"android.permission.INTERNET",
},
},
}
Syntax: native.showWebPopup( url [, options] )
native.showWebPopup( x, y, width, height, url [, options] )
url* = ជា URL Address របស់ Web
x,y,width,height = វាប្រើសំរាប់គ្រប់គ្រង់ Position & Dimension របស់ Web
option* (ជាជំរើស) = ប្រើសំរាប់បន្ថែម Parameters សំរាប់ PopUp
native.getSync()
ក្នុងការសរសេរ App វាមិនងាយស្រួលប៉ុន្មានទេ។ បើសិនជាងាយប្រហែលជានរណាក៏សរសេរដែរ ហើយរកលុយបានច្រើនហើយមើលទៅ។
សំរាប់ Native មួយនេះនឹងធ្វើការ Back Up ដោយ Automatic តែម្តងនៅក្នង system.DocumentDirectory សំរាប់តែ Mac & IOS សង្ឈឹមថា Android/ Window Phone/ Amazon / Nook នឹងមាន Function Sync នៅពេលក្រោយ។
Syntax: native.getSync (fileName, parms)
fileName: (តំរូវការ) ជាឈ្មោះរបស់ File
parms: (តំរូវការ) table { key = "iCloudBackUp" }
សំរាប់ Native មួយនេះនឹងធ្វើការ Back Up ដោយ Automatic តែម្តងនៅក្នង system.DocumentDirectory សំរាប់តែ Mac & IOS សង្ឈឹមថា Android/ Window Phone/ Amazon / Nook នឹងមាន Function Sync នៅពេលក្រោយ។
Syntax: native.getSync (fileName, parms)
fileName: (តំរូវការ) ជាឈ្មោះរបស់ File
parms: (តំរូវការ) table { key = "iCloudBackUp" }
Subscribe to:
Posts (Atom)

