Edit the Width and Height of the canvas like this
Fuzzy wrote:It is important when designing a game to decide on resource (CPU/RAM) limits for the player. One should not leave things open to unlimited growth like that. Decide on the maximum canvas size you will use, and if you need a smaller area, just use part of it.
You are the programmer. You must have tight control and constraints on your game if you wish to avoid all sorts of nasty trouble. Both for you and the player. That goes for things like player levels and equipment too.
Resizing canvas means resizing arrays, which is both an intensive use of ram and CPU, and can also run into problems of not enough ram, or not enough contiguous ram. It doesnt matter how fast your CPU is, nor how much ram you own. Resizing an array is slow and prone to failure.
To put it simple, resizing arrays is messy and buggy. Real game makers do not do this.
4erv' wrote:Well, I often do not understang these kind of texts (long, and requiring better english understanding), so i will just ask in a simple way:
If i would make a Paint in GE, is there any way to "fill" the canvas with white color? or show the white sprite sized the same as canvas?
Hblade wrote:Fuzzy wrote:It is important when designing a game to decide on resource (CPU/RAM) limits for the player. One should not leave things open to unlimited growth like that. Decide on the maximum canvas size you will use, and if you need a smaller area, just use part of it.
You are the programmer. You must have tight control and constraints on your game if you wish to avoid all sorts of nasty trouble. Both for you and the player. That goes for things like player levels and equipment too.
Resizing canvas means resizing arrays, which is both an intensive use of ram and CPU, and can also run into problems of not enough ram, or not enough contiguous ram. It doesnt matter how fast your CPU is, nor how much ram you own. Resizing an array is slow and prone to failure.
To put it simple, resizing arrays is messy and buggy. Real game makers do not do this.
Hey fuzzy, it dosnt actually resize anything, when using the lineto function, all it does it go the the set area that you placed, meaning, say... widht, the width is actually a canvas variable I created hehe... in other words, yeah the canvas IS the max width and height >.>
Hblade wrote:Yep, if you use this fucntion erase(255, 255, 255, 0);
4erv' wrote:Hblade wrote:Yep, if you use this fucntion erase(255, 255, 255, 0);
But how to fill only the resized square, not the all "Main window" canvas?
Users browsing this forum: No registered users and 1 guest