โดย M030 » 16/09/2015 6:04 pm
LibGDX คือ
GameFrameworkพัฒนาด้วยภาษา java ที่สามารถเล่นได้ทุก Platform (cross-platform) ทั้งบน
Windows,
Linux, Mac OS X,
Android, iOS หรือแม้แต่
HTML5บน
browser
ทำไมถึงต้องเป็น LibGDX
เพราะเพียงแค่ราเขียนโค๊ดเพียงแค่ครั้งเดียว ด้วย
javaและสั่ง deploy ไปหลายๆ platform ได้เลยทันที โดยไม่ต้องไปแก้ไขตัว source code โดยทาง Libgdx นั้นเตรียม ฟังค์ชั่นที่จำเป็น ให้เราหมดแล้วเช่น File System, Input Device, Render Sprites & Text, User Interface, Audio, OpenGL ^^
เครื่องมือที่ใช้เขียน
JDK
Android SDK
Eclipse หรือ ADT Bundle หรือ IntelijIDEA
โครงสร้างของ LibGDX
โครงสร้างของ LibGDX ประกอบไปด้วย
gdxahoy : เป็นโฟลเดอร์หลักสำหรับเขียนทั้งตัว MainGame, Game Loop ทุกอย่างทำในนี้หมดเลย
gdxahoy-android : สำหรับเปิดบน Android ไว้สำหรับเก็บ คลาส AndroidStarter และไฟล์ assets/ ต่างๆ จะถูกเก็บไว้ที่นี่
gdxahoy-html : สำหรับรันด้วย HTML5 โดยใช้ GWT ในการรัน เมื่อได้ไฟล์ war สามารถอัพขึ้นโฮสหรือ tomcat, jetty ได้เลย เหมือน java ทั่วๆไป
gdxahoy-desktop : สำหรับเปิดบน Desktop
gdxahoy-robovm : สำหรับเปิดบน iOS
[b][color=#0000FF][size=150]LibGDX [/size][/color][/b] คือ [url=https://www.mindphp.com/forums/viewtopic.php?f=28&t=22576]Game[/url][url=https://www.mindphp.com/%E0%B8%9A%E0%B8%97%E0%B8%84%E0%B8%A7%E0%B8%B2%E0%B8%A1/25-programming/oop-php-framework/1957-framework-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3.html]Framework[/url]พัฒนาด้วยภาษา java ที่สามารถเล่นได้ทุก Platform (cross-platform) ทั้งบน [url=https://www.mindphp.com/%E0%B8%84%E0%B8%B9%E0%B9%88%E0%B8%A1%E0%B8%B7%E0%B8%AD/73-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3/2124-windows-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3.html?hitcount=0&bb_limitstart=40]Windows[/url], [url=https://www.mindphp.com/%E0%B8%84%E0%B8%B9%E0%B9%88%E0%B8%A1%E0%B8%B7%E0%B8%AD/73-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3/2098-linux-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3.html]Linux[/url], Mac OS X, [url=https://www.mindphp.com/%E0%B8%84%E0%B8%B9%E0%B9%88%E0%B8%A1%E0%B8%B7%E0%B8%AD/73-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3/2051-android-os-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3.html]Android[/url], iOS หรือแม้แต่ [url=https://www.mindphp.com/%E0%B8%9A%E0%B8%97%E0%B9%80%E0%B8%A3%E0%B8%B5%E0%B8%A2%E0%B8%99%E0%B8%AD%E0%B8%AD%E0%B8%99%E0%B9%84%E0%B8%A5%E0%B8%99%E0%B9%8C/%E0%B8%9A%E0%B8%97%E0%B9%80%E0%B8%A3%E0%B8%B5%E0%B8%A2%E0%B8%99-html5.html]HTML5[/url]บน [url=https://www.mindphp.com/%E0%B8%9A%E0%B8%97%E0%B8%84%E0%B8%A7%E0%B8%B2%E0%B8%A1/66-server-hosting/1849-web-browser-%E0%B8%AB%E0%B8%A1%E0%B8%B2%E0%B8%A2%E0%B8%96%E0%B8%B6%E0%B8%87%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3-web-browser-%E0%B8%84%E0%B8%B7%E0%B8%AD.html]browser[/url]
[b][color=#FF00BF]ทำไมถึงต้องเป็น LibGDX[/color][/b]
เพราะเพียงแค่ราเขียนโค๊ดเพียงแค่ครั้งเดียว ด้วย [url=https://www.mindphp.com/%E0%B8%84%E0%B8%B9%E0%B9%88%E0%B8%A1%E0%B8%B7%E0%B8%AD/73-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3/2185-java-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3.html]java[/url]และสั่ง deploy ไปหลายๆ platform ได้เลยทันที โดยไม่ต้องไปแก้ไขตัว source code โดยทาง Libgdx นั้นเตรียม ฟังค์ชั่นที่จำเป็น ให้เราหมดแล้วเช่น File System, Input Device, Render Sprites & Text, User Interface, Audio, OpenGL ^^
[color=#FF00BF][b]เครื่องมือที่ใช้เขียน[/b][/color]
:arrow: [url=https://www.mindphp.com/%E0%B8%84%E0%B8%B9%E0%B9%88%E0%B8%A1%E0%B8%B7%E0%B8%AD/73-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3/2232-jdk-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3.html]JDK[/url]
:arrow: [url=https://www.mindphp.com/%E0%B8%84%E0%B8%B9%E0%B9%88%E0%B8%A1%E0%B8%B7%E0%B8%AD/73-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3/2261-sdk-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3.html]Android SDK[/url]
:arrow: Eclipse หรือ ADT Bundle หรือ IntelijIDEA
[b][color=#FF00BF]โครงสร้างของ LibGDX[/color][/b]
โครงสร้างของ LibGDX ประกอบไปด้วย
:arrow: gdxahoy : เป็นโฟลเดอร์หลักสำหรับเขียนทั้งตัว MainGame, Game Loop ทุกอย่างทำในนี้หมดเลย
:arrow: gdxahoy-android : สำหรับเปิดบน Android ไว้สำหรับเก็บ คลาส AndroidStarter และไฟล์ assets/ ต่างๆ จะถูกเก็บไว้ที่นี่
:arrow: gdxahoy-html : สำหรับรันด้วย HTML5 โดยใช้ GWT ในการรัน เมื่อได้ไฟล์ war สามารถอัพขึ้นโฮสหรือ tomcat, jetty ได้เลย เหมือน java ทั่วๆไป
:arrow: gdxahoy-desktop : สำหรับเปิดบน Desktop
:arrow: gdxahoy-robovm : สำหรับเปิดบน iOS