Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 16,643 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Sequentially replacing PANEL & TEXT #265084
05/10/09 06:35
05/10/09 06:35
Joined: May 2007
Posts: 6
K
kns Offline OP
Newbie
kns  Offline OP
Newbie
K

Joined: May 2007
Posts: 6
Okay this is likely embarrassingly trivial (and I have more)... how does one update/replace a PANEL display with something new? Imagine displaying an image until a key is pressed at which time the screen is cleared or TEXT is displayed followed by another image.

I have browsed the first few Workshop tutorials but could not find the solution.

Thanks

Re: Sequentially replacing PANEL & TEXT [Re: kns] #265103
05/10/09 10:11
05/10/09 10:11
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
hey, depends on what's in the panel, you can either change the bmap, or if you have a seperate panel, just make the old one invisible and the new on visible

Code:
void main(){
  while(!key_enter){wait(1);} //wait until the enter key is pressed
  pnl_this.bmap = new_bmp; //show new bmap
}
or
Code:
void main(){
  while(!key_enter){wait(1);} //wait until the enter key is pressed
  reset(pnl_old, SHOW); //hide previous panel
  set(pnl_new, SHOW); //show new panel
}

hope this helps

Re: Sequentially replacing PANEL & TEXT [Re: MrGuest] #265137
05/10/09 16:06
05/10/09 16:06
Joined: May 2007
Posts: 6
K
kns Offline OP
Newbie
kns  Offline OP
Newbie
K

Joined: May 2007
Posts: 6
Thank you.

Can this process be hardware accelerated with the bitmaps preloaded? Ultimately, the names of images will be read from a file into a STRUCT along with other information (e.g., x/y coord) while time elapsed, in ms, between display and key press will be critical.

Are there any benefits to doing this in legacy mode?

Again, I apologize for the basic nature of the questions. I am hoping to systematically reach a flexible end point which may necessitate very naive posts.

Code:
////////////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>

////////////////////////////////////////////////////////////////////

BMAP* first_pcx = "first.pcx"; 
BMAP* second_pcx = "main.pcx";


PANEL* first_pan = 
{
	pos_x = 0;
	pos_y = 0;
	layer = 1;
	bmap = first_pcx;
	flags = OVERLAY | VISIBLE;
}


/////////////////////////////////////////////////////////////////////

void main()
{
	video_mode = 7; 
	screen_color.blue = 150;


while(!key_enter)
{
	wait(1);
	} //wait until the enter key is pressed
  
  first_pan.bmap = second_pcx; //show new bmap	
	
}


Last edited by kns; 05/10/09 16:54.

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

Gamestudio download | 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