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
3 registered members (TipmyPip, AndrewAMD, NewbieZorro), 16,655 guests, and 7 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
scroll images #241368
12/15/08 19:23
12/15/08 19:23
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
Hi i have a question (whats new) I want to be able to press a button bmp and it should then show a pic, hit it again and it should show the next pic. This is so people can select a set number of ships before heading off into combat, so they shall have a choice of what kind of fleet they want. The pics will have a text writeup, speed strength and such so they would make up fleets of a mixture of fast attacks and capital ships.
so here is the panel code were about should i start to get what i want smile
[/code]
panel cards_selected
{
bmap = map_2;
window(680,50,250,250,map_3,250,250);
button = 760,300,but_1,but_2,but_1,null,null,null;///accept the ship to your fleet
button = 860,300,map_4,map_5,map_4,null,null,null;///scroll images right
button = 710,300,map_6,map_7,map_6,null,null,null;///scroll images left
button = 760,680,but_1,but_2,but_1,accept_choices,null,null;///launch the game
flags = overlay;
}
[/code]


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: scroll images [Re: jigalypuff] #241374
12/15/08 20:16
12/15/08 20:16
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
why not just write functions called next_card prev_card and assign them to buttons?


3333333333
Re: scroll images [Re: Quad] #241385
12/15/08 21:04
12/15/08 21:04
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
to do that would`nt i then have to have a differant panel per ship image that would lead to a lot of panels frown
Is there no way to have them appear in the window i defined?


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: scroll images [Re: jigalypuff] #241391
12/15/08 22:08
12/15/08 22:08
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
for that you can either use a WINDOW and scroll it but it's not a good solution in this case i guess.

another solution that will definetely help you is:

bmap b1 = "sp.tga";
bmap b2 = "sp2.tga";

panel ui {
bmap = b1;
flags = VISIBLE;
}

somewhere in a function:

ui.bmap = b2;

will change the panel bmap.


3333333333
Re: scroll images [Re: Quad] #241448
12/16/08 12:42
12/16/08 12:42
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
i am trying this but it only seems to want to work for two images, if i add an extra on in the scroll function in skips to the last one frown am i missing something really obvious here?


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: scroll images [Re: jigalypuff] #241451
12/16/08 13:11
12/16/08 13:11
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Code:
///////////////////////////////
//if this was lite-c i would make a BMAP* array, that would make life easier,especially at changebmap()
bmap b1 = "sp.tga";
bmap b2 = "sp2.tga";
bmap b3 = "sp3.tga";
panel ui {
	bmap = b1;
	flags = VISIBLE;	
}
var bmapno = 1;
on_e = changebmap;

function main(){
	wait(1);
}

function setbmap(bmp1){
	ui.bmap = bmp1;
}
function changebmap(){
	if(bmapno==1){
		setbmap(b2);
		bmapno =2;
		return;
	}
	if(bmapno==2){
		setbmap(b3);
		bmapno =3;
		return;
	}
	if(bmapno==3){
		setbmap(b1);
		bmapno =1;
		return;
	}
}


this cycles through 3 images?
this was the problem or i got you wrong?

if you assign changebmap to a button istead of E it should work.


3333333333
Re: scroll images [Re: Quad] #241504
12/16/08 18:46
12/16/08 18:46
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
chaining images in C-Script (.wdl)
'I' believe 'you' can use a var[array] to store images for use in a sequence.
Code:
// theory / example only;  code will NOT work as is 
BMAP im1 = "sp1.tga";
//-load them all from a directory automatically?
BMAP* im_;  // image pointer
var im_a[32]; // image (handle var) array
var im_nC = 0; // image count 0 - 31
var im_nI = 0; // current image index
//...
im_a[im_nC] = handle(im1);
im_nC+=1;
//...
//next image
im_nI+=1;
im_ = ptr_for_handle(im_a[im_nI]);
panel.bmap = im_;


Re: scroll images [Re: Quad] #241505
12/16/08 18:50
12/16/08 18:50
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
perfect man thanks smile


Why does everyone like dolphins? Never trust a species which smiles all the time!

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