1/9/2024 0 Comments Gideros if notThe lack of animation and the performance both can be detrimental for the application's success. Stage:addEventListener(Event.ENTER_FRAME, onEnterFrame)Įnjoy, I'm going to have a lot of fun with this.Sprites and Animation are one of the most important aspects of a Game. Oh:setPosition(x+oh.speed*oh.directionX, height/4) Stage:removeEventListener(Event.ENTER_FRAME, onEnterFrame) So you need to remove it and then re-add the new one. Because addEventListener keeps a reference to the function, if you redefine the function, the event listener will keep the old one around. So I wanted to see how this worked with that. Normally in a Gideros app you will have everything happening inside of an event handler. Then the code below it will run every time that it is downloaded. Notice it has a first run check by seeing if the myinfo variable is nil or not. Myinfo:setText("current repeat: ".repeatCount) Myinfo = TextField.new(nil, "loading files.") Here is a basic example of a file you could download. You have to write the downloaded file a certain way for it not to stomp on itself. The state of the downloaded file is maintained each time it is downloaded, so variables hold their values from the previous time. Every 2 seconds it will download your file(s) again and run them again. When you run the app it will show that it is downloading the file(s) and run them. Timer:addEventListener(Event.TIMER, onTimer) Local timer = Timer.new(seconds * 1000, 0) Loader = FileLoader.new(downloadURLs, "a") Return Texture.oldNew("|D|".filename, filtering, options)Īpplication:setOrientation(Application.LANDSCAPE_LEFT) Return Texture.oldNew(filename, filtering, options) Success, error = pcall( function() dofile("|D|".self.dofile) end )įunction Texture.new(filename, filtering, options) Self.loader:addEventListener(Event.PROGRESS, self.onProgress, self) Self.loader:addEventListener(Event.ERROR, self.onError, self) Self.loader:addEventListener(Event.COMPLETE, self.onComplete, self) Self.loader = UrlLoader.new(self.currentURL) :setText("loading ".self.currentFilename) Local download = not exists("|D|".self.currentFilename) Self.currentFilename = string.match(self.currentURL, ".*/(.*)" ) Self.currentDownload = self.currentDownload +1 If ( table.getn(self.urls) >= self.currentDownload ) then Print("error downloading ".self.currentURL) :setText("error downloading ".self.currentFilename) :setText(self.currentFilename." downloaded") Local out = io.open("|D|".self.currentFilename, "wb") Here is the code (Note, this version uses UrlLoader and is compatible with Gideros 2012.2.2 and later). Export the project and put it on your device.Find loader = FileLoader.new(downloadURLs, "a") and replace a with the file you want to run.If you need to download other images, put the url's in downloadURLs.Find downloadURLs in the code and put your url there.Get the link to the file (use the Dropbox website).Put a file on some webserver (like your Dropbox Public folder).Put the code below in a Gideros Studio project.Only do this on your iPhone using Xcode and your own developer account. If you did it and got it past the reviewers, you'd likely have your developer account revoked when caught. It's one of the the main reasons the AppStore is curated, to prevent this. I've been doing this and it works great.īy the way, you should never try to get an app on the AppStore that does this. Want to run an iPhone (or Android device) app built with Gideros Studio (developer account required) and simultaneously change it's source code and have those changes affect the running app (aka "live coding")? This also allows you to edit on an iPad using Textastic or other Dropbox capable editor and immediately run the code on an iPhone. DIY Capacitive Stylus for iPad and iPhone.Mounting VirtualBox HFS+ VDI files on OS X.Reading the keychain with a perl script.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |