Jump to content

Sprite + Map, Only shows Sprite (?)

- - - - -

  • Please log in to reply
1 reply to this topic

#1
FenixEden

FenixEden

    Newbie

  • Members
  • Pip
  • 6 posts
Okay, I have a lot of code, But i'll do it short.

First
I have a SpriteImage_Paint() {} function wich works fine.
It includes a lot of e->Graphic->DrawImage();
in order to draw just the map.

this works.
But when i Move my character who is also in the Sprite Image Paint, it all gets slow.
It's because it draws the map every each pixel my character moves.

Is there any way to get it faster?

#2
kernelcoder

kernelcoder

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 309 posts
  • Location:Dhaka
  • Programming Language:C, Java, C++, C#, Visual Basic .NET
  • Learning:Objective-C, PHP, Python, Delphi/Object Pascal
The idea is: keep your background painting (the map) in a buffer (only the first time) and draw the other sprites/characters on it when your character changes it's position. Then finally draw the combined paining on the DC.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users