Beneath a Steel Sky/Broken Sword interface

Started by Steel Drummer, Thu 11/05/2006 22:47:26

Previous topic - Next topic

Steel Drummer

How do I make an interface like Beneath a Steel Sky (eg: mouse changes to a cross when you move over a hotspot, inventory appears at bottom or top of screen when you move the mouse over it)
I'm composing the music for this game:



Candle

#1
Sorry posted the wrong thing again. lol
I use :
//mouseover forward
SaveCursorForLocationChange();
SetMouseCursor(11);

///mouseover return
SaveCursorForLocationChange();
SetMouseCursor(13);

//mouseleft
SaveCursorForLocationChange();
SetMouseCursor(12);

//mouseright
SaveCursorForLocationChange();
SetMouseCursor(10);
These are for my arrows.

Scummbuddy

ChangeModeGraphic
(Formerly known as ChangeCursorGraphic, which is now obsolete)

Mouse.ChangeModeGraphic(CursorMode, int slot)

Changes the specified mouse cursor mode's cursor graphic to SLOT. This permenantly changes the specified mode's cursor graphic. This function may be useful if you need more than the maximum number of mouse cursors.
Example:

mouse.ChangeModeGraphic(eModeLook, 120);

will change the cursor's graphic for look mode to the image that's imported in the sprite's manager slot 120.
See Also: Mouse.ChangeModeHotspot, Mouse.ChangeModeView, Mouse.Mode
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Khris

I was in the mood :P

Code: ags
function repeatedly_execute() {
 Ã, int x=mouse.x;
 Ã, int y=mouse.y;
 Ã, Hotspot*hot=Hotspot.GetAtScreenXY(x, y);
 Ã, Object*obj=Object.GetAtScreenXY(x, y);
 Ã, Character*cha=Character.GetAtScreenXY(x, y);

 Ã, int mmode=eModeWalkTo; Ã,  // standard cursor i.e. mouse isn't over anything
 Ã, if (hot!=null || obj!=null || cha!=null) mmode=eModeInteract; Ã,  // crosshair cursor
 Ã, Mouse.Mode=mmode;

 Ã, // Inventory GUI at bottom of the screen
 Ã, if (y>310 && gInv.Visible==false) gInv.Visible=true;
 Ã, if (y<290 && gInv.Visible==true) gInv.Visible=false; Ã, // 210 if the GUI is 30 px high and screen is 240px high
}

function on_mouse_click(MouseButton button) {
 Ã, if (IsGamePaused() == 1) {
 Ã,  Ã, // Game is paused, so do nothing (ie. don't allow mouse click)
 Ã, }
 Ã, else if (button == eMouseLeft) {
 Ã,  Ã, ProcessClick(mouse.x, mouse.y, eModeInteract);
 Ã, }
 Ã, else if (button == eMouseRight) {
 Ã,  Ã, ProcessClick(mouse.x, mouse.y, eModeLook);
 Ã, }
}


For the inventory, use a custom GUI with an inventory window as big as the GUI (except maybe arrows to the left and right), name the window e.g. "invwindow" and call invwindow.CharacterToUse = player; in game_start().

This should work/be complete, if not, I'm tired ;)

SSH

You can use system.viewport_height and gInv.Height to make that code more generic, KhrisMUC...

* SSH feels a module comign on
12

SMF spam blocked by CleanTalk