1 registered members (tomaslolo),
1,542
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Rotating the bitmap inside a window
[Re: Anonymous2009]
#267253
05/22/09 18:53
05/22/09 18:53
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Inside your panel, place this control. (tested) needle(xx,yy,"clock.tga",XXX,YYY,AA,SS,FF,the_time); where : xx,yy is the images top-left position within the panel. clock.tga is the CENTERED, circular image, using alpha channel for transparency. XXX,YYY is the CENTER of the image, the pivot point that is. AA is the rotational offset. SHOULD be zero. SS is the minimum number of the range FF is the maximum number of the range. the_time is the variable the rotation is calculated from.
eg needle(0,0,"clock.tga",32,32,0,0,24,the_time); Will create a transparent clock at position 0,0 within the panel. The clock will rotate about its center (assuming a 64x64 image), based on the hour of the day stored in the_time...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Rotating the bitmap inside a window
[Re: EvilSOB]
#267262
05/22/09 19:50
05/22/09 19:50
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
Expert
|
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
hmm.. I think he want´s this for a rotated mpa.. When placing a bitmap inside a window, and the window is smaller than the bitmap.. the bitmap is cut off at the end of the window.. and rest is hidden.. Now he wants to rotate the bitmap inside ( like on some worldmaps, that are rotating with the player ).. Like this:
|
|
|
Re: Rotating the bitmap inside a window
[Re: Espér]
#267304
05/23/09 04:28
05/23/09 04:28
|
Joined: Jan 2009
Posts: 38
Anonymous2009
OP
Newbie
|
OP
Newbie
Joined: Jan 2009
Posts: 38
|
Thanks, EvilSOB, but Espér is correct, what I plan to do is this: Red area is the bitmap, Black border is the window, and the center_x and center_y are the center of the bitmap.
|
|
|
Re: Rotating the bitmap inside a window
[Re: Anonymous2009]
#267339
05/23/09 10:33
05/23/09 10:33
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
OK, i see. Try this instead. Heres the code, or DL a working sample project with bmaps HERE (up/down arrows change the time)
var my_time = 0; //0.00 to 24.00
BMAP* clock_face = "#256x256x24";
PANEL* my_clock =
{
needle(64,128, "clock.bmp", 128,128,0,0,24, my_time);
flags = SHOW;
}
void my_clock_startup() { my_clock.target_map = clock_face; }
PANEL* my_panel =
{
pos_x = 10; pos_y = 10;
bmap = "clock_back.bmp";
size_x = 192; size_y= 192;
window(25,25,128,128,clock_face,0,0);
digits(25,155,"Time = %5.2f","arial#18b",1,my_time);
flags = SHOW;
}
Any questions, fire away...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Rotating the bitmap inside a window
[Re: Quad]
#267514
05/24/09 16:54
05/24/09 16:54
|
Joined: Jan 2009
Posts: 38
Anonymous2009
OP
Newbie
|
OP
Newbie
Joined: Jan 2009
Posts: 38
|
|
|
|
|