Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Rotating the bitmap inside a window #267210
05/22/09 14:48
05/22/09 14:48
Joined: Jan 2009
Posts: 38
Anonymous2009 Offline OP
Newbie
Anonymous2009  Offline OP
Newbie

Joined: Jan 2009
Posts: 38
Hi,

The idea is to have a picture of a sun and a moon within a window(), and rotate it based on the timer. I'm stuck with how to rotate the picture alone and not the whole panel, can you help me?

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 Offline
Expert
EvilSOB  Offline
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 Offline
Expert
Espér  Offline
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:



Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
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 Offline OP
Newbie
Anonymous2009  Offline 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 Offline
Expert
EvilSOB  Offline
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)

Code:
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: EvilSOB] #267340
05/23/09 10:42
05/23/09 10:42
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
hey, good idee wink


3333333333
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 Offline OP
Newbie
Anonymous2009  Offline OP
Newbie

Joined: Jan 2009
Posts: 38
Thank you, EvilSOB. ^^


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1