Menu

Show posts

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 Menu

Messages - MonkeySyrup

#1
Hm, your first solution requires a lot of hard coding and precision. Second solution is good, but I have 50 books, I would need 100 sprites only for one GUI, so now I have background of all the books and bookshelf and 50 sprites of pulled out books.

IMO, all solutions are quite good, but most of them just wouldn't work for me or they would require a lot more work.
#2
Oh, thanks. I'm pretty sure it will be helpful :)
#3
Thanks guys, you were very helpful. I'll probably go with changing Width & Height, because Snarky's solutions just wouldn't work for me:

-I have only one sprite
-I want it to be clickable even when it is invisible
-That's a good solution, but I have a lot of different size books, so I would need different transparent sprites. It's not worth doing that
#4
Yeah, I found a problem. When I change NormalGraphic to 0, the button becomes very small. I'll need to find another solution
#5
But if I set Image to 0 on GUI, it just shows 4 red rectangles in button corners, and that's what I want. Does it mean that Image and NormalGraphic is not the same thing?
#6
I understand that your approach is better, but I wanted to do it like in this photo (one place zoomed in, but you can still see the main room):
Spoiler
[close]

And I thought that GUI would be a better approach. I'll change it to room if the GUI approach won't work as I want it to
#7
Quote from: ManicMatt on Tue 17/03/2020 09:34:09
Would using the visible = true; code work? (Probably not)

Or importing an empty sprite with the same dimensions? I can't think of an instance where the player would want to click on something invisible in a GUI, so i'm curious what it is you're trying to achieve?

I'm trying to create a GUI of bookshelf. When you click on a book, you pull a book out, that's when I change graphic number to 128. When I click on the same book one more time, you push the book in and the graphic number will be changed to 0
#8
Looks like it works with another graphic number, but why doesn't it work with Graphic 0? And no, it's not blue cup, Graphic 0 just makes it invisible/transparent. Is it possible that changing graphic number to 0 makes the button really small?
#9
Problem is in the subject. I don't know if it actually disappears or just somehow changes it's position, but maybe someone knows why it happens?

Here's my simple function:
Code: ags
function book1_OnClick(GUIControl *control, MouseButton button)
{
  if(book1.NormalGraphic == 0)
      book1.NormalGraphic = 128;
  else
      book1.NormalGraphic = 0;
}
#10
Hi. I'm trying to create hotspots/objects/characters highlighting system for my game using GUI and I have a question: is it possible to use same GUI in the multiple places at the same time? I probably already know the answer, but hopefully I'm wrong.

Thanks in advance
#11
I tried that now and it actually works. Thanks!
#12
So I was trying to combine VerbCoin and GotThere module into one BASS style project and I encountered a problem: VerbCoin doesn't show up when I click on hotspots. In GotThere module there is a on_mouse_click function
Code: ags

function on_mouse_click(MouseButton button) {
  if (button == eMouseLeft) {
    ClaimEvent();
    lt = GetLocationType(mouse.x, mouse.y);
    if (lt == eLocationNothing) {
      __arrived = true;
      ProcessClick(mouse.x, mouse.y, mouse.Mode);
    }
    else {
      __arrived = false;
      if (lt == eLocationHotspot) {
        Hotspot*h = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
        lid = h.ID;
      }
      else if (lt == eLocationObject) {
        Object*o = Object.GetAtScreenXY(mouse.x, mouse.y);
        lid = o.ID;
      }
      else if (lt == eLocationCharacter) {
        Character*c = Character.GetAtScreenXY(mouse.x, mouse.y);
        lid = c.ID;
      }
      mm = mouse.Mode;
      ProcessClick(mouse.x, mouse.y, mm);
    }
  }
}


If I comment third line or if I delete this module, then everyone works fine. That's odd, because a few days ago I used them both and it worked fine, but then I changed GotThere module into latest version and now it doesn't work properly. And yes, I tried changing it to older version, it didn't help. Is there a way to make everything work perfectly without completely changing VerbCoin and module scripts? Maybe someone had similar problems?
Thanks in advance
#13
Oh, so that's what I was doing wrong. Now I'll know. Thanks!
#14
Thanks for help!
#15
Oh, mine shows

Code: ags

enum Dir {
  eLeft,
  eRight,
  eDown,
  eUp
};

import bool WalkFace(int x, int y, Dir d);


I'll search for 0.2 version then
#16
But that doesn't work for me, because error "undefined symbol 'GotThere'" shows up. Do I need to write something more somewhere else or am I using wrong version of this module?
#17
I tried to use Khris's GotThere module, but it looks like I won't be able to understand it myself and I think that it is a little bit changed since latest mentions of this module in this forum. So here's my function:

Code: ags

function hGoLeft_Interact()
{
  if(!WalkFace(90, 660, eLeft))
  {
    player.ChangeRoom(2, 1320, 700);
  }
}


I'm just trying to change room when player reaches coordinates (90, 660), but when I click on hotspot, player moves to coordinates (mouse.x, mouse.y) and don't change room. Maybe I just use wrong function or just don't know how to use it correctly. As I understand, bool GotThere and function GoFace doesn't exist anymore. Hopefully, module's author will be able to help me
SMF spam blocked by CleanTalk