Use a function SetupButton(GUIControl *button, int gfx, string description, int topictostart, .......)
and setup every button individually.
and setup every button individually.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: strazer on Sat 11/06/2005 15:42:29
Arrays of pointers are possible:
GUIControl *Icons[4] = gButtons.Controls;
function OrganizeIcons() {
int NumberOfIcons = 3; // <-- IMPORTANT: Insert here the number of icons you use
// Don't touch variables below!
int IconPositionX = 0;
int IconNumber = 0;
GUIControl *Icon;
while (IconNumber < NumberOfIcons) // NumberOfIcons was defined at the top of the script
{
Icon = gButtons.Controls[IconNumber];
if (Icon.Visible == true)
{
Icon.X = IconPositionX;
IconPositionX = (IconPositionX + Icon.Width);
}
IconNumber++;
}
gButtons.X = (system.screen_width - IconPositionX - Icon.Width) / 2; // Center the GUI
}
Quote from: GarageGothic on Sat 11/06/2005 11:41:34
short buttonx = 0; //where the leftmost button will be on the gui.
short numofbuttons = 8;
short buttonnum = 1;
Quote from: Billy Gnome Jefferson on Sat 11/06/2005 09:32:10Dunno... Do you get an error message?
I have a problem with the script though. It's picking up problems. Is this because I have an older of AGS? Must I update it?
function on_mouse_click(MouseButton button) {
// called when a mouse button is clicked. button is either LEFT or RIGHT
if (IsGamePaused() == 1) {
// Game is paused, so do nothing (ie. don't allow mouse click)
}
else if (button == eMouseLeft) {
if (mouse.Mode == eModeWalkto)
{
if (GetWalkableAreaAt(mouse.x, mouse.y) > 0)
ProcessClick(mouse.x, mouse.y, eModeWalkto);
else
{
/* Look for walkable area */
int i, wa, x;
i = 0;
x = mouse.x;
wa = GetWalkableAreaAt(character[Player.ID].x, character[Player.ID].y);
while ((i <= game.room_height) && (GetWalkableAreaAt(x, i) != wa)) i++;
/* End look for w.a. */
if (i <= game.room_height) ProcessClick(mouse.x, i, eModeWalkto);
/* Note: doesn't do nothing if no walkable area is found on the screen column where the player clicked */
}
}
else
ProcessClick(mouse.x, mouse.y, mouse.Mode);
}
else { // right-click, so cycle cursor
mouse.SelectNextMode();
}
}
Quote from: stranger on Wed 25/05/2005 20:36:35Oh, a pretty little (famous) bug in IE...
Now if I want to save and upload him as a .gif file into AGS I know I can do this, however the problem is when I try to right click and save him I can only save him as a.bmp file and not as a .gif file...Any ideas as to how I can transport him into AGS?
type = GetLocationType(mouse.x, mouse.y)
if (type == eLocationHotspot) {
Hotspot* h Hotspot.GetAtScreenXY(x, y);
h.GetPropertyText("Desc", buf);
} else if (type == eLocationObject) {
Object* o = ...
Quote from: Scorpiorus on Thu 20/05/2004 22:25:50Could it be a good idea to have an entry in the .cfg file that specifies what .vox file is currently selected so AGS would use it to play speech?
Quote from: Scorpiorus on Thu 20/05/2004 21:07:25I don't know if there is a way to tell AGS which one to use but a workaround would be to have speech.eng and speech.ger and copy one or another to speech.vox before launching AGS game. I appreciate it requires some additional work (like writing a setup or maybe a simple batch file) but it can be accomplished.
QuoteNow it says I'm recreating too many overlays.Ã,Â
if (xpos==320) overlay = CreateTextOverlay (0,80,650,1,15,"This is a text overlay");
if (xpos==290) {
RemoveOverlay(overlay); // Delete previous message
overlay = CreateTextOverlay (0,80,650,1,15,"This is another text overlay");
}
if (xpos==250) {
RemoveOverlay(overlay); // Delete previous message
overlay = CreateTextOverlay (0,80,650,1,15,"This is another text overlay");
}
if (xpos==200) {
RemoveOverlay(overlay); // Delete previous message
overlay = CreateTextOverlay (0,80,650,1,15,"This is another text overlay");
}
if (xpos==320) overlay = CreateTextOverlay (0,80,650,1,15,"This is a text overlay");
if (xpos==290) {
RemoveOverlay(overlay); // Delete previous message
overlay = CreateTextOverlay (0,80,650,1,15,"This is another text overlay");
}
if (xpos==250) overlay = CreateTextOverlay (0,80,650,1,15,"This is a text overlay");
if (xpos==220) {
RemoveOverlay(overlay); // Delete previous message
overlay = CreateTextOverlay (0,80,650,1,15,"This is another text overlay");
}
if (xpos==200) overlay = CreateTextOverlay (0,80,650,1,15,"This is a text overlay");
if (xpos==180) {
RemoveOverlay(overlay); // Delete previous message
overlay = CreateTextOverlay (0,80,650,1,15,"This is another text overlay");
}
SetViewPort(xpos, 0); //REMOVED!
if (xpos==320) ...etc etc...
if (xpos==290) ...etc etc...
function my_cutscene() {
StartCutscene(5);
* int overlay, xpos = 320;
* SetViewPort(xpos, 0);
* while (xpos > 0) {
Ã, // Display text. I used overlays since they aren't blocking and they don't move while scrolling the sceen
Ã, if (xpos==320) overlay = CreateTextOverlay (0,80,650,1,15,"This is a text overlay");
Ã, if (xpos==290) {
Ã, Ã, RemoveOverlay(overlay); // Delete previous message
Ã, Ã, overlay = CreateTextOverlay (0,80,650,1,15,"This is another text overlay");
Ã, }
Ã, // ..
Ã, SetViewport(xpos, 0);
Ã, Wait(5);
*Ã, xpos--;
}
ReleaseViewport(); // Returns the viewport as it was before the cutscene - maybe non necessary in your game
RemoveOverlay(overlay); // Remove the last message
EndCutscene();
}
function my_cutscene() {
StartCutscene(5);
int overlay, xpos = 0;
while (xpos < 60) {
Ã, // Display text. I used overlays since they aren't blocking and they don't move while scrolling the sceen
Ã, if (xpos==0) overlay = CreateTextOverlay (0,80,650,1,15,"This is a text overlay");
Ã, if (xpos==30) {
Ã, Ã, RemoveOverlay(overlay); // Delete previous message
Ã, Ã, overlay = CreateTextOverlay (0,80,650,1,15,"This is another text overlay");
Ã, }
Ã, // ..
Ã, SetViewport(xpos, 0);
Ã, Wait(5);
Ã, xpos++;
}
ReleaseViewport(); // Returns the viewport as it was before the cutscene - maybe non necessary in your game
RemoveOverlay(overlay); // Remove the last message
EndCutscene();
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.043 seconds with 14 queries.