Please help me I am dumb I guess

Posted By: The_Unknown_Game

Please help me I am dumb I guess - 01/31/10 02:44

okay so I am guessing I'm dumb cause I can't figure out how to make the black in a window transparent to show the layer 1 which the window is on layer 2 is there a way to do it if so can some one show me a code snip or explain really well to me

and thank you in advance for your help
Posted By: Widi

Re: Please help me I am dumb I guess - 01/31/10 03:07

flags = OVERLAY;
That is for Panels. The Engine Window, you don`t can set the black transparent.
Posted By: The_Unknown_Game

Re: Please help me I am dumb I guess - 01/31/10 03:16

ok i was just trying to make my scrolling image with the black be transparent in my little window on my game screen but i guess i cant so no i have to decide on a new method and rewrite a lot of my code oh boy but thank you tho i guess this engine can't do everything lol oh well I'm going to have to look for a new one cause if it can't do something like that its not worth it i guess
Posted By: Redeemer

Re: Please help me I am dumb I guess - 01/31/10 04:24

Umm, you can set the black parts of your panels to be transparent. Like Widi said, just write "flags = OVERLAY;" into your panel definition.

EDIT: For future reference, The_Unknown_Game: before you ask simple questions like this, look for answers in the User's Manual. If your copy of Gamestudio didn't come with a manual (for whatever reason), just use the online manual, which can be found on the side bar in this forum. Thank you.
Posted By: The_Unknown_Game

Re: Please help me I am dumb I guess - 01/31/10 08:23

okay let me try to explain this in easier terms where you all might under stand ok like the window not a panel like the window in the lite-c workshops #5 example #2 the one with the altitude is the a way to make that black transparent and if you say to do flags = OVERLAY | SHOW; then don't bother answering me cause then u don't know what i am talking about and need to do that workshop your self to understand what i mean by a window on the game screen but if you do know what i am talking about then great and you know how to make the bitmap black transparent the that is even better and here is some of my code to explain what i am trying to do

Code:
PANEL* sample_pan =
{
	layer = 2;
// THIS IS A WINDOW BELOW I NEED TO MAKE TRANSPARENT WITH BLACK RGB 0,0,0
	window (0, 500, 800, 50, "select.png", 0, select);
	flags = OVERLAY | SHOW; // OVERLAY DOESN'T MAKE THE BLACK IN THE WINDOW TRANSPARENT
}




ok there maybe that will help you guys understand now if it was a normal panel then yes " flags = OVERLAY | SHOW; " would work but not for the window that is why i need help
Posted By: Ottawa

Re: Please help me I am dumb I guess - 01/31/10 14:55

Hi!


You have created a window in your panel.

Now you have to put something larger that the window behind it
and write the code to move this bitmap

Look at the compass example.
Posted By: Widi

Re: Please help me I am dumb I guess - 01/31/10 14:59

Use for the window a Bitmap with a alpha cannel (*.tga), and change the black into a color with alpha = 0.
Posted By: Ottawa

Re: Please help me I am dumb I guess - 01/31/10 16:20

Hi!

Here's a code snip.
You will have to draw a bitmap with your Draw program to make it work.
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////
////////////////////// ---- my folders 
#define PRAGMA_PATH "..\\Models";
#define PRAGMA_PATH "..\\des_tga";
#define PRAGMA_PATH "..\\des_pcx";
#define PRAGMA_PATH "..\\panels";

//

// Global variables

BMAP* clr_strip = "yourbmap.pcx"; // make a bitmap that's 596x76 
var compass_x = 0; // horizontal 
var compass_y = 0; // vertical 

// Panels

PANEL* SANTE = {
	// bitmap clr_strip is 596x76
	// the window must be smaller than the bitmap clr_strip
	// The visible part is  180 x 60
	// the function show_panel modifies the values of compass_x or _y : this creates the movement
	//
	// 
	pos_x = 100;
	pos_y = 375;
	layer = 2;
	window (15,14,180,60,clr_strip,compass_x,compass_y); 
	digits (-60,-10, "compass_x = %.0f",*,1, compass_x); // to follow the values ... to be removed after testing
	flags = SHOW; //| OVERLAY not needed here
}

// functions

function show_panel ()
{
	var up = 0;
	var down = 100;
	compass_x = 0;
	// move the bmap from left to right.....
	while (1)
	{
		if (compass_x >= 100)
		{
			down = 100;
			// up becomes down 
			while (down != 0)
			{
				compass_x -= 5 ;
				down -= 1;
				wait (1)  	;
			}
		}
		if (compass_x <= 0)
		{
			up = 0 ;	
			// down becomes up
			while (up <= 99)
			{
				compass_x += 5 ;
				up  += 1;
				wait (1)  	;
			}
		}
		wait (1)	;
	}
}
//--------------------------- 

function main()
{
  vec_set(screen_size,vector(800,600,0));
  vec_set(screen_color,vector(50,1,1)); // dark blue
  vec_set(sky_color,vector(50,1,1)); // dark blue

  video_window(NULL,NULL,0,"My New Game");
  
  level_load("");

	show_panel ();
}


Posted By: The_Unknown_Game

Re: Please help me I am dumb I guess - 01/31/10 20:08

ok so i tried to set the alpha to 0 but i get an error can anyone show me how to set the alpha to 0 just a little code snip or really good explain would help thank you
Posted By: KDuke

Re: Please help me I am dumb I guess - 01/31/10 20:19

Thats not made with a code snippet. You do it in an image manipulation program like GIMP or Photoshop. Just add an alpha channel to the image and use the eraser to remove everything you want to have transparent.
Posted By: The_Unknown_Game

Re: Please help me I am dumb I guess - 01/31/10 20:24

i did that but the transparent is set to 50 how can i set it to 0 so the alpha is completely gone on the game screen
Posted By: KDuke

Re: Please help me I am dumb I guess - 01/31/10 20:35

Strange... might you consider uploading this image somewhere so I can take a look at it?
Posted By: The_Unknown_Game

Re: Please help me I am dumb I guess - 01/31/10 21:02

tga download

here is the file i hope i did this right
Posted By: KDuke

Re: Please help me I am dumb I guess - 01/31/10 23:30

Well it definitely is in the right file format. Yet it does not provide an alpha-channel. Thats why it isn't transparent. Which program do you use for editing your images? If it is GIMP here is the way to do it:
Option 1: New image

1. Start The GIMP
2. Press File->New
3. In the dialog where you can choos the dimensions click on advanced settings
4. For filling choose transparent
5. Draw you image

Option 2: Adding alpha to an existing image

1. Start The GIMP
2. Load your picture
3. In the layers window right-click "Background" and choose "Add alpha channel"
4. Either use the eraser to delete unwanted areas or use the magic wand, path tool or color selection tool to select the undesired area and remove it with a hit onto the delete key on your keyboard.

greetings K-Duke
Posted By: The_Unknown_Game

Re: Please help me I am dumb I guess - 01/31/10 23:47

finally thank you all
© 2024 lite-C Forums