Stupid question about one strange thing

Posted By: Varen

Stupid question about one strange thing - 08/09/09 18:12

Im making hp bar atm using "window" command. Thats how it looks:

Code:
var altitude = 0; 

PANEL* first_pan =
{
  layer=1;
window (0, 55, 64, 64, "hp.tga", 0, altitude);
flags = SHOW;
}

PANEL* hh =
{
 bmap = "Dc_02Lion.tga";
 flags= SHOW;
 layer=2;
}

PANEL* srodek =
{
	bmap="srodek.tga";
	pos_x=7;
	pos_y=57;
	flags=SHOW;
	layer=0;
}



Height.tga is health image, Dc_02Lion.tga is a kind of frame over it and srodek.tga is the background. The code looks ok and everythings is ok as long as im using height.pcx instead of hp.tga (i mean the example from workshop). If i place hp.tga at there and changing dx and dy for it, the altitude var stops reacting for its change. I change it for 20, -20, 50, 0, and hp.tga bitmap is still at the same place. What am i doing wrong? Why height.pcx works and my image doesnt? (i tried hp.pcx too)
Posted By: Xarthor

Re: Stupid question about one strange thing - 08/09/09 18:18

I suspect that your file does not have the right format.
Would you please be so kind to post both images here? (hp.tga and height.pcx)
Posted By: Varen

Re: Stupid question about one strange thing - 08/09/09 18:26


Height.pcx





hp.tga
Posted By: Xarthor

Re: Stupid question about one strange thing - 08/09/09 18:44

Well you got a 64x64 graphic and want to display a cutout of it which is what size?
That it works with the height.pcx file has this reason:
- The cutout is smaller than the actual image file and thus you can display a small part of it and "scroll" over the image.

Here is the important quote from the workshop:
Quote:

Conclusion: When you create a window, you will only see a small part of the bitmap used for it. Change variable_x or variable_y (altitude in our script) and the long bitmap will be shifted along the x or y axis, displaying other parts of the bitmap on the screen. The size of the cutout window in pixels (the visible part of the bitmap) is given by size_x and size_y.


Using window you cannot make the cutout larger or smaller but only move its position about the background image (height.pcx for example)
Posted By: Varen

Re: Stupid question about one strange thing - 08/09/09 18:52

U mean such image should work?



It doesnt
Posted By: Xarthor

Re: Stupid question about one strange thing - 08/09/09 18:58

Well yes it _should_ work. Its easy saying "it doesn't", so could you please tell us which values you used to get it to work?
Posted By: Varen

Re: Stupid question about one strange thing - 08/09/09 19:24

Code:
var altitude =0; 


PANEL* first_pan =
{
  layer=1;
window (0, 55, 64, 400, "hp3.jpg", 0, altitude);
flags = SHOW;
}



Effect:




________________________________________
________________________________________

Code:
var altitude =60; 


PANEL* first_pan =
{
  layer=1;
window (0, 55, 64, 400, "hp3.jpg", 0, altitude);
flags = SHOW;
}



Effect:


© 2024 lite-C Forums