Hi! Good day,
I’m Julian Martin. This is my first time building an Android App and I just want to ask for some techniques and tips that could help me with my project.
Well, I’ve got couple of questions to ask regarding my project and thank you very much in advance.
- My project has a lot of images.
- I use this images to create an animation effect to my app and I display this images using this code “display.newImageRect()” because I want the image on fullscreen. Example, I have an image of a closed cabinet then when tap it, the cabinet will open… I use object.alpha = 0 to hide the image of the close cabinet then alpha = 1 to show the open one.
Is this kind of method is fine?
- Freeing Memory and Texture.
-
I use the code I found to check the current memory and texture that my app consumes. And I noticed that some of my app’s scene consumes almost 500KB of memory.
-
Is there a way to release memory and texture every scene change? Or is there a way to lessen the consumption of memory and texture?
Image:
Code:
er01= display.newImageRect (“er01.jpg”,xWidth,yHeight,isFullResolution)
er01.x = _W*0.5; er01.y = _H*0.5
er01:addEventListener ( “tap”, animate)
sceneGroup:insert(er01)
er02 = display.newImageRect (“er02.jpg”,xWidth,yHeight,isFullResolution)
er02.x = _W*0.5; er02.y = _H*0.5
er02.alpha = 0
sceneGroup:insert(er02)
local function animate ( event )
er05.tween = transition.to( er05, {time = TRANSITION_TIME - 800, alpha = 0})
er03.tween = transition.to( er03, {time = TRANSITION_TIME - 800, alpha = 1})
return true
end
This is the sample of my images, and this is the sample code I’am using to make an animation.
Thank you.
Sincerely,
Julian