|
3 registered members (Quad, TipmyPip, Grant),
5,429
guests, and 3
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Button problem
#271210
06/11/09 19:10
06/11/09 19:10
|
Joined: Feb 2009
Posts: 3,207 Germany, Magdeburg
Rei_Ayanami
OP
Expert
|
OP
Expert
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
|
Hello! i am writing a script for lerning lite-c. I use lite-c at this moment. Here is my script: PANEL* TIMEs_pan =
{
digits(580, 300, 2, "Arial#150b", 1, sys_seconds);
flags = SHOW;
}
PANEL* TIMEm_pan =
{
digits(580, 300, 2, "Arial#150b", 1, sys_minutes);
}
function change()
{
reset(TIMEs_pan, SHOW);
set(TIMEm_pan, SHOW);
}
PANEL menu_pan =
{
bmap = menu_back;
pos_x = 128;
pos_y = 128;
button(256, 256, "off.bmp", "on.bmp", "over.bmp", change, NULL, NULL);
flags = SHOW;
}Why this doesen´t work??? I get an error with the Button.
|
|
|
Re: Button problem
[Re: Rei_Ayanami]
#271211
06/11/09 19:14
06/11/09 19:14
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
PANEL -> PANEL* if this doesnt work, try defining bmaps for button on, off and over pictures instead of defining them with ""
Ubi bene, ibi Patria.
|
|
|
Re: Button problem
[Re: croman]
#271213
06/11/09 19:22
06/11/09 19:22
|
Joined: Feb 2009
Posts: 3,207 Germany, Magdeburg
Rei_Ayanami
OP
Expert
|
OP
Expert
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
|
/////////////////////////////////////////
#include <acknex.h>
#include <default.c>
/////////////////////////////////////////
BMAP* back = "background_01.bmp";
BMAP* back2 = "background_02.bmp";
BMAP* menu_back = "menu_back.bmp";
BMAP* on = "on.bmp";
BMAP* off = "off.bmp";
BMAP* over = "over.bmp";
/////////////////////////////////////////
PANEL* back_pan =
{
bmap = back;
pos_x = 0;
pos_y = 0;
layer = 10;
flags = OVERLAY | VISIBLE ;
}
PANEL* back2_pan =
{
bmap = back2;
pos_x = 0;
pos_y = 0;
layer = 9;
flags = OVERLAY | VISIBLE ;
}
PANEL* TIMEs_pan =
{
digits(580, 300, 2, "Arial#150b", 1, sys_seconds);
flags = SHOW;
}
PANEL* TIMEm_pan =
{
digits(580, 300, 2, "Arial#150b", 1, sys_minutes);
}
function switch_min()
{
reset(TIMEs_pan, SHOW);
set(TIMEm_pan, SHOW);
}
PANEL* menu_pan =
{
bmap = menu_back;
pos_x = 128;
pos_y = 128;
button(256, 256, "off.bmp", "on.bmp", "over.bmp", switch_min, NULL, NULL);
flags = SHOW;
}
function main()
{
video_mode = 10;
screen_color.red = 150;
mouse_mode = 1;
while(1)
{
wait(-1);
set(back_pan,SHOW);
wait(-1);
reset(back_pan,SHOW);
}
}
Does not work. No it shows one problem more: "off.bmp not found" but it´s in the folder. and it still shows the butten problem...
|
|
|
Re: Button problem
[Re: Rei_Ayanami]
#271241
06/11/09 22:48
06/11/09 22:48
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Try this (untested) /////////////////////////////////////////
#include <acknex.h>
#include <default.c>
/////////////////////////////////////////
BMAP* back = "background_01.bmp";
BMAP* back2 = "background_02.bmp";
BMAP* menu_back = "menu_back.bmp";
BMAP* b_on = "on.bmp";
BMAP* b_off = "off.bmp";
BMAP* b_over = "over.bmp";
/////////////////////////////////////////
PANEL* back_pan =
{
bmap = back;
pos_x = 0;
pos_y = 0;
layer = 10;
flags = OVERLAY | VISIBLE ;
}
PANEL* back2_pan =
{
bmap = back2;
pos_x = 0;
pos_y = 0;
layer = 9;
flags = OVERLAY | VISIBLE ;
}
PANEL* TIMEs_pan =
{
digits(580, 300, 2, "Arial#150b", 1, sys_seconds);
flags = SHOW;
}
PANEL* TIMEm_pan =
{
digits(580, 300, 2, "Arial#150b", 1, sys_minutes);
}
function switch_min()
{
reset(TIMEs_pan, SHOW);
set(TIMEm_pan, SHOW);
}
PANEL* menu_pan =
{
bmap = menu_back;
pos_x = 128;
pos_y = 128;
button(256, 256, b_on, b_off, b_over, switch_min, NULL, NULL);
flags = SHOW;
}
function main()
{
video_mode = 10;
screen_color.red = 150;
mouse_mode = 1;
while(1)
{
wait(-1);
set(back_pan,SHOW);
wait(-1);
reset(back_pan,SHOW);
}
}
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Button problem
[Re: Rei_Ayanami]
#271403
06/12/09 22:05
06/12/09 22:05
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Excellent that problem fixed, but that still doesnt explain the error with "off.bmp". If its still a problem, try changing its filename to "b_off.bmp". The words "on" and "off" are both engine "reserved words" and it may be having troubles because of that.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Button problem
[Re: Dooley]
#272228
06/17/09 00:12
06/17/09 00:12
|
Joined: Jul 2008
Posts: 1,178 England
MrGuest
Serious User
|
Serious User
Joined: Jul 2008
Posts: 1,178
England
|
Mouse Mode4 - mouse pointer active and automatically moved Mouse PointerIn fullscreen mode the system cursors are not visible; only a mouse_map can be used for the fullscreen cursor.
should help
|
|
|
|