Edit the Canvas Width and Height

Post here your demos and examples with the source files.
Forum rules
Always post the games with a screenshot.
The file must have the ged and data files (complete game source)
Use the forum attachment to post the files.
It is always better to use the first post to put the game files

Edit the Canvas Width and Height

Postby Hblade » Wed Aug 19, 2009 4:36 am

Edit the Width and Height of the canvas like this
example.gif
Attachments
Sizing Canvas.zip
(266.16 KiB) Downloaded 208 times
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Edit the Canvas Width and Height

Postby 4erv' » Wed Aug 19, 2009 10:14 pm

This could be useful in strategy games! like the ability to resize your territory where you can build your town :D
Great job!
+1 Point
Gold Basketball 2008 - the first basketball game made with game editor.

User avatar
4erv'
 
Posts: 188
Joined: Sat Jul 07, 2007 10:52 am
Location: in Recycle Bin
Score: 10 Give a positive score

Re: Edit the Canvas Width and Height

Postby Fuzzy » Thu Aug 20, 2009 6:48 am

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.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Re: Edit the Canvas Width and Height

Postby Hblade » Thu Aug 20, 2009 5:31 pm

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 >.>
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Edit the Canvas Width and Height

Postby 4erv' » Thu Aug 20, 2009 9:42 pm

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? :D
Gold Basketball 2008 - the first basketball game made with game editor.

User avatar
4erv'
 
Posts: 188
Joined: Sat Jul 07, 2007 10:52 am
Location: in Recycle Bin
Score: 10 Give a positive score

Re: Edit the Canvas Width and Height

Postby Hblade » Thu Aug 20, 2009 10:19 pm

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? :D

Yep, if you use this fucntion erase(255, 255, 255, 0);
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Edit the Canvas Width and Height

Postby Fuzzy » Thu Aug 20, 2009 11:45 pm

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 >.>



Sorry. I didnt read it very well, and overlooked the demo. I thought it was a request for resizable canvas. Ignore my rant, ok? :P
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Re: Edit the Canvas Width and Height

Postby Hblade » Fri Aug 21, 2009 7:05 am

Lol sure thing, I didnt know you can actually resize something though
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Edit the Canvas Width and Height

Postby 4erv' » Fri Aug 21, 2009 8:45 am

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?
Gold Basketball 2008 - the first basketball game made with game editor.

User avatar
4erv'
 
Posts: 188
Joined: Sat Jul 07, 2007 10:52 am
Location: in Recycle Bin
Score: 10 Give a positive score

Re: Edit the Canvas Width and Height

Postby Hblade » Fri Aug 21, 2009 4:21 pm

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?

I too was wondering the same thing >.>
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Edit the Canvas Width and Height

Postby 4erv' » Fri Aug 21, 2009 9:39 pm

I have only one idea. To fill it using lineto with a white line that is as wide as the square is :D
Gold Basketball 2008 - the first basketball game made with game editor.

User avatar
4erv'
 
Posts: 188
Joined: Sat Jul 07, 2007 10:52 am
Location: in Recycle Bin
Score: 10 Give a positive score

Re: Edit the Canvas Width and Height

Postby Hblade » Fri Aug 21, 2009 9:56 pm

Yeah but that would jsut place 1 line, you need to fill the whole thing up O.o then if you made the size of it large it would make a big giant block, it wouldnt have the curved edges
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Edit the Canvas Width and Height

Postby 4erv' » Fri Aug 21, 2009 10:10 pm

Okay, 20 minutes and all done :D
Here's the demo:
FillSQR.zip
(53.05 KiB) Downloaded 138 times
Gold Basketball 2008 - the first basketball game made with game editor.

User avatar
4erv'
 
Posts: 188
Joined: Sat Jul 07, 2007 10:52 am
Location: in Recycle Bin
Score: 10 Give a positive score

Re: Edit the Canvas Width and Height

Postby Hblade » Sat Aug 22, 2009 2:00 am

Hey this is pretty good but if you can make it instant thatd be cool too :D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Edit the Canvas Width and Height

Postby 4erv' » Sat Aug 22, 2009 9:15 am

i think with function lineto that is not imposible :D
Gold Basketball 2008 - the first basketball game made with game editor.

User avatar
4erv'
 
Posts: 188
Joined: Sat Jul 07, 2007 10:52 am
Location: in Recycle Bin
Score: 10 Give a positive score

Next

Return to Game Demos

Who is online

Users browsing this forum: No registered users and 1 guest