Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Dacapo

Pages: [1]
1
Window / Not return "canva" when window.display() ?
« on: November 05, 2021, 07:36:29 pm »
I'm making a project where I want that drew elements with window.draw() don't disappear when I run window.display(). It seems that this code:

window.draw(item);
window.display();
window.draw(item);

make item doesn't disappear when we reuse window.display(). I think it's because window is like a piece of paper drew on one side and showed on the other. When we call window.display(), the paper is returned and we now draw on the other side.
However, I need a lot of efficiency in my code, and I was wondering if it was possible to draw directly on the side of the paper that is showed so that when we call window.display(), the "piece of paper" isn't returned but just showed with all items (these that were already drew and these that were drew just before window.display())

I apologize if my English is barely understandable (I'm not native speaker),  I did the best I could to explain my problem.
Thanks in advance !

2
Does any method that move the sprite/shape according to his rotation. For example if it is rotated by 90 degrees, it will move forward by x:1 and y:0, if it is rotated by -90 it will move forward by x:-1 y:0 if it is rotated by 0 degrees it will move forward by y:1 x:0  etc...
Or do I have to do all the calculus by myself ? If I have to, what are the most efficient function to code ?

Pages: [1]
anything