![]() By changing the object's x and y properties, however, we can move the background image to a new location.įor this project, we'll place the background in the center of the screen - but what if we don't know exactly which coordinate values represent the center? Fortunately, Solar2D provides some convenient shortcuts for this. ![]() ![]() Immediately following the line you just entered, add the two highlighted commands: local background = display.newImageRect( "background.png", 360, 570 )īy default, Solar2D will position the center of an object at the coordinate point of 0,0 which is located in the upper-left corner of the screen. The final step for the background is to position it at the correct location on the screen. In this case, we'll simply use the image's pixel dimensions, although as noted above, display.newImageRect() allows you to resize/scale the image via these numbers. The next two parameters, 360 and 570 specify the size that we want the background image to be. The specified name must match the actual file name exactly, including case-sensitive matching! For instance, if the actual file name is background.png, do not enter it as "BackGround.PNG". In this case, that value will be an image used as your background. A variable, just like you learned in math class, is used to store a value. The first word, local, is a Lua command indicating that the next word will be a variable.There are a several aspects involved with this command. Local background = display.newImageRect( "background.png", 360, 570 ) In this a file, type in the highlighted command:. This is the Lua file with which the application starts, every time you run the app. The a file is the foundational "core program file" of every Solar2D project and you cannot create an app without it. Using your chosen text editor, locate and open the a file within your project folder. While there are ways to change the layering order of images and send them to the back or front of the display stack, we'll keep this project simple and load them in a logical order. Solar2D places everything on the screen from back to front in regards to layering, so the first image we load will exist behind other images that are loaded afterward. And plugins, which can be very helpful.The first image that we need to load is the background. Plus they say it has a OOP approach, which I assume will help me since I'm used to a class based system from Java. But is closed source with no community plugins/addons. I think I have narrowed down the SDKs to Corona and Gideros.Ĭorona just seems like a lovely package with lots of resources and such, seems great for a beginner. So as a first project I'm going to translate my Android calculator apps into LUA to help me get started with the language, then re-release them on PLAY and now also iTunes. I've never done anything with physics or major animations. I've made some specialized calculators for Android, and PC based simple projects with Java in Uni. ![]() I'm a novice programmer, which mainly only experience in Java. LOVE is only PC and MOAI seems a little too much for a beginner. I have done searches and spent hours browsing similar topics. After searching and browsing I've come to the conclusion that LUA looks like a good language to learn for a beginner into making games.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |