-Canvas Codes-

From Game Editor

Revision as of 21:52, 26 September 2008 by Diormeh (Talk | contribs)
Jump to: navigation, search

Draw Window Codes

Draw Square

void Draw_Square()
{
   setpen(255,255,255,0,3);
   moveto(1,1);
   lineto(width-1,1);
   moveto(0,0);
   moveto(0,0);
   lineto(0,height-1);
   lineto(width-1,height-1);
   lineto(width-1,height-1);
   lineto(width-1,0);
}

Draw X

void Draw_X()
{
   setpen(255,255,255,0,3);
   moveto(0,0);
   lineto(width,height);
   moveto(width,0);
   lineto(0,height);
}

Draw a Minus

void Draw_Minus()
{
   setpen(255,255,255,0,3);
   moveto(7,height/2);
   lineto(width-7,height/2);
}

Draw that Maximize square

void Draw_Max()
{
   setpen(255,255,255,0,1);
   moveto(5,5);
   lineto(5,height-5);
   lineto(width-5,height-5);
   lineto(width-5,5);lineto(5,5);
   moveto(5,6);
   lineto(width-5,6);
}

Draw a Top Bar

Void Draw_Bar()
{
   float i = 0;
   for(i=0;i<width;i++)
   {
      setpen((i/width) * 255, (i/width) * 255, (i/width) * 255 , 0 , 1);
      moveto(i,0);
      lineto(i,height);
   }
}

How to use it:

On the X Canvas button, put in create/draw actor:

Draw_Square();
Draw_X();

On the Minus Canvas button, put in create/draw actor:

Draw_Square();
Draw_Minus();

On the wierd square thingy (Maximize), put:

Draw_Square();
ms();

on the bar:

Draw_Bar();

for the window itself:

Draw_Square();

then arrange them how you want. It should end up somthing like this:

Image:Window.png