Mintoris

Author Topic: animation and layers  (Read 4294 times)

z6am

  • Full Member
  • ***
  • Posts: 13
animation and layers
« on: Mar 03, 2014, 12:09 PM »
Is there any concept of layered bitmaps that allow for animation without re-drawing the entire screen every time? I would like to animate a bitmap while maintaining a one or more static background images.

I'm just getting back to Mintoris after a long while and I had a quick look through the forum as well as the updated manual, but the examples that animate drawings or bitmaps all clear the screen and redraw everything each cycle.

Let me know if I missed this somewhere or whether it's not possible.

Thank you,
Z

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: animation and layers
« Reply #1 on: Mar 03, 2014, 12:34 PM »
You're describing the features of a game engine. The screen does not have to be totally cleared and redrawn each frame. You could code a game engine library in Basic if you wanted where only portions of the screen where updated when needed (holding differnent layers in memory as bitmaps). But I don't think you would be gaining much. Modern mobile devices are very fast and they can redraw the screen at a good frame rate.

Check out this demo. I used some interesting time based movement techniques.

Bitmap Array Demo

-Chuck

mickbrown

  • Full Member
  • ***
  • Posts: 10
Re: animation and layers
« Reply #2 on: Mar 31, 2014, 02:09 AM »
How can the screen be cleared

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: animation and layers
« Reply #3 on: Mar 31, 2014, 09:44 AM »
How can the screen be cleared

The screen is cleared with the CLS command.

rendomizer

  • Full Member
  • ***
  • Posts: 87
Re: animation and layers
« Reply #4 on: Dec 13, 2015, 06:52 AM »
i dont understand the drawbitmap command when it moves... somme times it showing and somme times it not why ?

there's my code
Code: [Select]
graphics on
color 100,100,0
pic=loadimage("cartman.png")
debut:
fori=1 to 900 step .01
color 100,100,0
circle 100+i,100+i,50,1
drawbitmap pic,100+i,100+i
next i
goto debut

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: animation and layers
« Reply #5 on: Dec 13, 2015, 08:53 AM »
You need to add a wait 1 in the loop. This allows Android to do it's work. Commands like Touch or TouchEvent have an automatic Wait built in. If you don't put in a Wait an automatic wait happens every 500ms and that is when things move.

drawbitmap pic,100+i,100+i
Wait 1
next i

rendomizer

  • Full Member
  • ***
  • Posts: 87
Re: animation and layers
« Reply #6 on: Dec 13, 2015, 10:23 AM »
ok it run fine now thanks chuck

but i have another probleme with the exemple here http://www.mintoris.com/basic16270.html

it not work !

i have a green screen at all !


Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: animation and layers
« Reply #7 on: Dec 13, 2015, 11:31 AM »
Rendomizer, you must start paying attention to where you post things. This thread is about animation and layers. It has nothing to do with the Wait 1 problem. Start a new topic if you have a question. Problems belong in the problems and solutions board. By posting wherever you feel like posting you are messing up the forum and generating more work for me.

Hope that isn't too harsh. Your comments are always really good and interesting. They just need to be put in the right place.

When in doubt, start a new topic.

-Chuck
« Last Edit: Dec 13, 2015, 11:34 AM by Chuck »

rendomizer

  • Full Member
  • ***
  • Posts: 87
Re: animation and layers
« Reply #8 on: Dec 13, 2015, 01:09 PM »
ok  chuck i understand it 5/5