Simple but useful: Text window without images

Game Editor comments and discussion.

Simple but useful: Text window without images

Postby Hblade » Tue Mar 08, 2011 10:13 pm

This function allows you to draw a simple window handling both custom color per window, and opacity of the back part of the window. The command is easy as
Code: Select all
drawWin(r, g, b, transparency);

NOTE that this has to be in a Canvas Actor. The width and height are dependent on the canvas.
Simply replace r g b with the colors you want, and anywhere between 0 - 1 (EG: 0.50), where transparency is. Here's what this looks like :3
WindowOfAwesome.jpg


The code: Copy and paste this in the Global Code
Code: Select all
void drawWin(int R, int G, int B, double TRANS) {
    int i;
    setpen(R, G, B, TRANS, 1);
    moveto(3, 3);
    for (i=3;i<height-4;i++) {
        moveto(3, i);
        lineto(width-4, i);
                             }
    setpen(R*1.2, G*1.2, B*1.2, 0, 3);
    moveto(0, 0);
    lineto(0, height-1);
    lineto(width-1, height-1);
    lineto(width-1, 0);
    lineto(0, 0);
    setpen(R/2, G/2, B/2, 0, 3);
    moveto(4, 4);
    lineto(4, height-5);
    lineto(width-5, height-5);
    lineto(width-5, 4);
    lineto(4, 4);
                 }
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: Simple but useful: Text window without images

Postby again » Tue Mar 08, 2011 10:19 pm

Plus +1 for that useful info.
Free windows mobile games like doodle jump and super mario bros
http://krenisis.freeforums.org/
again
 
Posts: 258
Joined: Wed Jan 19, 2011 7:06 pm
Score: 33 Give a positive score

Re: Simple but useful: Text window without images

Postby Hblade » Wed Mar 09, 2011 12:10 am

Thanks
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: Simple but useful: Text window without images

Postby Camper1995 » Fri Mar 11, 2011 9:58 am

Pretty simple to use and looks great in game. Good job Hblade.

Yesterday, I have made a button for games using canvas. Check it out. I just wanna share it with you, maybe you'll think about where to use it :D
It can be resized to any size.

canvas button Windows XP.ged
(2.15 KiB) Downloaded 87 times


I was trying to make button that looks like from WinXP :lol:
Say hello to my little friend.
User avatar
Camper1995
 
Posts: 707
Joined: Tue Dec 30, 2008 7:20 pm
Location: Lost in the past.
Score: 44 Give a positive score

Re: Simple but useful: Text window without images

Postby Hblade » Fri Mar 11, 2011 5:51 pm

awesome dude :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


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest