draw gui

  1. K

    GameMaker How do I draw a sprite dependent on a variable?

    I have a variable "energy" and a two sprites, "sprEnergyHalf" and "sprEnergyFull". How do I draw a sort of bar with these sprites? i.e. If "energy" is at 2, draw one sprEnergyFull. If "energy" is at 3, draw one sprEnergyFull and one sprEnergyHalf. If "energy is at 1, draw one sprEnergyHalf. You...
  2. R

    SOLVED Floodfill code for my paint program

    If there's a thread with the same problem, maybe one with a solution, please link me to it. I'm making a paint-style program and I have the drawing tool and the erase tool. All I need is a floodfill tool similar to the one in this video. I tried importing the code from this page, however it is...
  3. W

    GameMaker Inventory Items are not displaying in Draw GUI!

    Hey guys, I have been following this tutorial to set up my inventory system. However, instead of drawing through the draw event as he does, I am now trying to move all of that to the draw GUI event. Problem is, I can't get my items to display in my inventory when I pick them up. Everything else...
  4. A

    Legacy GM [SOLVED] point_in_rectangle not registering correctly with some GUI buttons

    Hola! Before you roll your eyes, I know there are a bunch of similar posts already but I've given them an eyeball and the suggestions in those (eg. device_mouse_x_to_gui, view_x) seem to have no impact whatsoever. I thought maybe drawing clickable buttons to the GUI when using a view had an...
  5. V

    GML Can't draw sprite in Draw GUI Event

    Hello, I'm trying to draw a panel with health(hearts) but nothing shows up. Here's my Draw Gui Event(for panel object): for (i = 0; i < player.life; i++) { coord = global.hearts_coords; draw_sprite(heart, -1, x + coord[0], y + coord[1]); } Every variable was checked with debugging and...
  6. bsabiston

    GameMaker GMS1.4 -> GMS2 broken button behavior

    I imported my GMS 1.4 game to GMS 2 and boy it has not been smooth. One new issue I hit today: I have a button, a persistent object at depth 0. When the player presses it, I change the depth to -100 to bring it above some other stuff. Later, when they press it again, I put the depth back to...
  7. O

    GML Text not drawn

    greetings, I'm working on a top down RPG and would like to implement some text boxes. this is what I have so far: (Draw GUI event for obj_conversation) //textbox draw_set_color(fill); draw_set_alpha(0.95); draw_rectangle(camera_get_view_width(0)/32, 6.3/9*camera_get_view_height(0)...
  8. E

    Draw object on GUI layer

    I know the GUI layer is drawn on top of everything else and is not affected by the camera. I'm able to draw an object on the GUI layer using draw_self. However, the object does not appear where I expect it to. Is there a way I can change the coordinates of an object on the GUI layer? If so...
  9. S

    Legacy GM Pixel Perfect by RangerX transparency issue

    Hello, I had interpolation issues upon fullscreen toggling and used the Pixel Perfect method posted by RangerX to fix this. It works well and looks great, however some aspects of the game are drawing strangely: The left is without Pixel Perfect. The right is with Pixel Perfect. The issue in...
  10. S

    GameMaker GUI Scaling Working Differently on Separate Computers

    This set of code: guiAspectScaling = 0.1; display_set_gui_size(display_get_width(), display_get_height()); display_set_gui_maximise(guiAspectScaling, guiAspectScaling, 0, 0); works fine on my computer. Everything seems to scaled correctly. And even when I create an executable of my game, and...
  11. S

    GameMaker [SOLVED] Health Bar not showing correct HP

    I set up a health bar to go along with my player's hp (which is 4), but for some reason the health bar image itself is acting as if my player only has 3 hp. I attached an image to showcase the issue. Here is my objGUI's Create Event: // Set Global Variable global.playerhp = 4; And the Draw...
  12. Vintendi

    GameMaker (SOLVED) Draw GUI is off centre [Beginner]

    I've recently had an issue with my project I've been creating in game maker studio 2. Recently when trying to do stuff in the draw event it appears off centre. This does not occur with draw_sprite or draw_text it occurs with draw_grid and draw_circle. It only happens on this project. In Draw...
  13. T

    GameMaker Help with DRAW GUI event creating object instances

    Hi All, This is my first post and first of all sorry for my english it is not my mother tongue so I will explain myself as better as I can (and of course thanks for reading this). I am creating a tower defense game but I am facing some strange behaviours that I could find neither internet or...
  14. P

    GameMaker Placing *objects* in the GUI

    So, I've managed to draw sprites in the gui (using the Draw GUI event), no problem - but how do I place *objects* in the gui? I've made an ugly hack that does the trick, but I'd like to know how to do it properly (presumably with draw GUI)? //makes the button object follow the view in...
  15. S

    [Solved] Health bar won't update

    Hello. I have given one of my instances a health bar, but it does not work. The bar is drawn, but it does not change as the object's health decreases. It just stays as a green rectangle. I have tried ading if statements (if player exists, create healthbar) and I also tried to remove the event...
  16. D

    Draw GUI, Window and sprite scaling

    Hi community, i am currently having headaches with this: I have my game running on 1280x800 which i set to be the required minimum resolution. I am using only Draw GUI events to draw text and gradients and stuff. Now from time to time i need to draw sprites as well. Here is where my problem...
  17. Jezla

    Question - IDE [SOLVED] Compile Error Doesn't Make Sense

    I'm getting a compile error that is unrelated to the actual code it points to. Here's the error: Here's the script in question: The script is called in the create event of my main controller object. The error didn't show up until I added the following line to the controller's draw GUI...
  18. I

    Draw GUI Background

    DISCLAIMER: English is not my first language, so I might have English grammar mistakes, so I wanna apologize for that in advanced. So my problem is, I need to draw a vignette effect over my screen, and when I press and R button, from black vignette it needs to switch into orange. I am trying to...
  19. J

    [SOLVED] Help with "For Loop"

    Hello, I have an end level object created when the player reaches the end of my level, with a draw gui event... it basically shows level performance, and then keypress options to proceed or exit, etc. I want it to show how many coins were collected by the player. To do this I have created a...
  20. I

    GML [SOLVED]Rectangle grow (animation)

    I am trying to animate a rectangle growing form the top left corner to the bottom right one but it wont work and I don't know why. //=========================// // DRAW GUI // //=========================// //Inventory if (keyboard_check(ord("E"))) { //Check if E...
Top