Hello. I am about to release my first game. I need preloader for my game. I searched on forum but couldnt find anything. Does anyone know how we can create preloader?
There isn't a concept of preloader in Gideros but you can put a loading image at the beginning and load all your assets at the first ENTER_FRAME event. You can use an implementation like:
local loading = Bitmap.new(Texture.new("loading.png"))
stage:addChild(loading)localfunction preloader()-- load all your assets here
stage:removeChild(loading)
loading =nil
stage:removeEventListener(Event.ENTER_FRAME, preloader)-- start your game hereend
stage:addEventListener(Event.ENTER_FRAME, preloader)
AFAIK - You can't get any progress as to the loading of an individual asset, however if you have a lot of images, you can manage your own loading screen by simply counting off each image as it's loaded and updating a progress bar during your onEnterFrame listener function.
WhiteTree Games - Home, home on the web, where the bits and bytes they do play! #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
AFAIK - You can't get any progress as to the loading of an individual asset, however if you have a lot of images, you can manage your own loading screen by simply counting off each image as it's loaded and updating a progress bar during your onEnterFrame listener function.
@hnim, if you can use the enter frame with flags that keep track of each item loaded/queued, etc, then you could effectively have a loading screen with animation.
@hnim, if you can use the enter frame with flags that keep track of each item loaded/queued, etc, then you could effectively have a loading screen with animation.
but i dont think this can make smooth animation. so i need to waint next version with async texture loading feature.
Comments
There isn't a concept of preloader in Gideros but you can put a loading image at the beginning and load all your assets at the first ENTER_FRAME event. You can use an implementation like:
Likes: turgutcs
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
@hnim: Minh? See my message on vietgamedev? :P