Button problem

Posted By: SoulRyder

Button problem - 01/06/09 10:43

Hello,

Right now i'm doing the Lite-C Game Development workshops (http://www.conitec.net/litec/) I just arrived at workshop 6, but now i got a problem.

They tell me to run script06 file, but when i do this it should be possible to click on the Quit button, and it should change color while clicking or moving the mouse cursor over it.

Now the problem is, i can't click it, it doesn't change color while moving over or clicking on it. I didn't change anything in the code yet so that can't be the problem.

The code:

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

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

function main()
{
video_mode = 7;
screen_color.blue = 150;
mouse_mode = 4;
}

function quit_program()
{
while (key_any) {wait (1);}
sys_exit(NULL);
}

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

PANEL* main_pan =
{
bmap = "main.pcx";
pos_x = 250;
pos_y = 200;
button (250, 134, "quitclicked.pcx", "quitnormal.pcx", "quitover.pcx", quit_program, NULL, NULL);
flags = OVERLAY | VISIBLE;
}

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

Does anyone know if this problem happens to more people or something.

Thanx in advance.
Posted By: MrGuest

Re: Button problem - 01/06/09 11:05

hey,

have you looked at mouse_mode?
Posted By: SoulRyder

Re: Button problem - 01/06/09 11:08

"I have used three bitmaps for the "Quit" button, and I have activated the mouse through mouse_mode = 4. We will ignore the mouse details in this workshop, but we will talk a little about the tiny function that shuts down the program when we click the button."

This is what they say about it in the workshop.
I tried to change the mouse mode to 1, or delete the mouse mode but that didnt work either.
Posted By: MrGuest

Re: Button problem - 01/07/09 01:43

hey, i'd thought someone would of sent you another reply... but as not... if you want to send me your project jks_here@hotmail.com i'll have a further look into why it isn't working

from what you're showing at the moment unless you've saved you're .pcx files as the same file with diff names i can't see a problem
Posted By: SoulRyder

Re: Button problem - 01/07/09 18:25

Thanx,

I downloaded the litec samples from http://server.conitec.net/down/litec.zip

But when u load the script from workshop06, load it in script editor and test run it, the Quit button is supposed to turn green or red when the mouse goes over it and the program should shut down when clicking it.

But when i try it i can't do anything with the button, i cant click it and it also doesn't change color.
Posted By: Widi

Re: Button problem - 01/07/09 22:48

You have the Pictures "quitclicked.pcx" + "quitnormal.pcx" + "quitover.pcx" in the same foulder like your script?
Posted By: MrGuest

Re: Button problem - 01/08/09 01:27

Originally Posted By: Widi
You have the Pictures "quitclicked.pcx" + "quitnormal.pcx" + "quitover.pcx" in the same foulder like your script?
the map wouldn't compile if they were missing

strange, i've copied all the files and had it working without any adjustments

add into your code between button and flags the digit line, and see if your mouse is compatible and showing movement, the code is otherwise correct
Code:
	button (250, 134, "quitclicked.pcx", "quitnormal.pcx", "quitover.pcx", quit_program, NULL, NULL); 
	digits (0, 0, 4, *, 1, mouse_pos.x);
	flags = OVERLAY | VISIBLE;

Posted By: Carlos3DGS

Re: Button problem - 01/08/09 03:15

the code seems correct...
if running in window mode click anywhere on the game window to make sure it is focused
Posted By: Zetamancer

Re: Button problem - 01/09/09 02:45

Hey, I'm having the exact same problem, word for word. Any one got any advice? Adding the digits line between the button and flag lines didn't fix anything for me.
Posted By: GamerX

Re: Button problem - 01/09/09 02:57

what version do you have?
Posted By: Zetamancer

Re: Button problem - 01/09/09 04:58

My SED version is 7.02.4, and I'm using GameStudio 7. Not sure if that's what you meant.
Posted By: Zetamancer

Re: Button problem - 01/10/09 06:00

Anyone got any advice or solutions?
© 2023 lite-C Forums