1. Kleber_Ferreira

    GML Creating sprite from surface on a certain layer

    I'll try to explain what I want to do the best I can. I've been looking into the function sprite_create_from_surface, so I can save a sprite from whatever is drawn in a certain spot on my screen. What I need for my design is actually to create this sprite "behind the curtains". The player...
  2. Daniel Mallett

    GMS 2 Depth

    When you draw somthing then draw something else, the last 'draw' code will cause that to be on top. Is there any way to tell the draw functions which layer I intend for it to be drawn regardless of its chronological position as it were?
  3. F

    Java Extension returns a Bitmap(img) as a Byte[] as a String and in GM change it back to sprite.How?

    Hi, so I have a java extension( java code: ). It has 1 function and the function have 1 argument that is a String called fname. And it returns a String. The function should get the file from the path of fname and if it's an image file, get it as a Bitmap. then I...
  4. FrancisClase

    HTML5 javascript native drawing functions on a GML surface

    Is there a way to use the native javascript drawing functions in a GML surface? I am creating an on-screen drawing game and I would like to be able to use the native javascript functions to draw, since the stroke and performance are perfect ... if I had to implement a drawing algorithm with...
  5. Vidinu

    GMS 2 [SOLVED] Problem with particles into a surface

    Hi Game Maker community! I trying to draw particles in a new surface with other sprites/elements but even with the same code they looks different than in the application surface. In fact, when are drawing in the surface the pixels of the circle below the particles are not been drawn. By...
  6. Joh

    So, do I want high GPU?(shader..surface)

    Hi, started using shaders and I've noticed they lead to High GPU usage. (which I'm fairly sure is by design) I'm using the Xor blur, and it essentially doubles my GPU usage from 25% to 50% First I thought that was bad and I had to fix this, but reading upon it, it seems like its a good thing...
  7. F

    [Solved] Drawing only part of a shadow cast by using a surface

    Hello and thanks for reading, I followed a tutorial of casting shadows made by FriendlyCosmonaut where a single instance of an object called obj_shadows generates a surface and draws shadows of other instances by using with() in its draw event. Without going into too much detail I am having...
  8. J

    GMS 2 Drawing to Surfaces once outside Draw Event

    The official yoyogames documentation for draw_clear_alpha says that it is "only for use in the draw event of an instance (it will not show if used in any other event)". However drawing to a surface one time and then saving it to a sprite required me to do it outside a draw event, which worked...
  9. FoxyOfJungle

    GMS 2 [SOLVED] How to get mouse position relative to surface area?

    The main problem: As you can see in that GIF, I can scale it so that It will always stay 1:1. But I want to zoom in and out, and this is the problem. I will explain next: I created a surface instead of using the Draw GUI event (I need to, because later I'll need to copy that created GUI...
  10. Sozidar

    GMS 2 [Solved] How to reduce the file size of the saved buffer?

    Original png file size is 3.58 kb and file size of the saved buffer is 1088 kb, which is kinda sad. Is there a way around this, or am I doing something wrong? Any help is greatly appreciated :) w = 128; h = 2176; surf = surface_create(w,h); surface_set_target(surf)...
  11. D

    GMS 2 Surface questions

    I read here that surfaces should be kept small, but are great for optimization. This was a few years ago, thus I am asking. What is the rule of thumb here? "The English phrase rule of thumb refers to a principle with broad application that is...
  12. Michael Stearns

    GMS 2 Drawing to surface on many objects without reset_surface_target()

    Hey everybody~ I'm trying to do a bit of a strange thing where, explaining briefly, I want to draw a bunch of low res objects on top of a big high res object. It's a single screen game. To accomplish this cleanly, I thought I'd draw all the objects to a surface at low resolution, then in GUI...
  13. SubWolf

    GMS 2 [SOLVED] Tranparent Sprites in Surfaces

    Hello everyone, I'm in trouble dealing with sprites that have some transparent parts. When I draw them in a surface (the surface has a background colour) the transparent part shows what's behind the surface. I'm uploading an image of this problem here. The code is something like this: ->...
  14. RipRoarinBoogerBenis

    Clearing Surfaces

    I followed a somewhat out of date tutorial to build a simple lighting system I intend to expand, but while it works for the most part, the sprite bound to the mouse and the triangle primitives created by the walls leave behind afterimages like a windows 98 error. I've gone through a few forums...
  15. S

    Unbalanced Surface Stack error, but not using surface_set_target anywhere

    Hello, I've been working on a game in GMS 1.4.1804. All of a sudden, I'm getting the error message "Unbalanced surface stack. You MUST use surface_reset_target() for each set." This occurs when the player is being prompted to enter a high score. I tried searching my game for the...
  16. Jihl

    Need a hand with surface and lighting!

    Hey there! I need to apply a lighting effect on my game depending on the players position, the room is very big so I can't draw a black screen on the whole room or it gets laggy. This is the draw event of my obj_lighting_controller var b = 600 var c = 1000 if !surface_exists(lSurf) lSurf...
  17. jobjorgos

    Legacy GM how to create surface only in the area of view[0]?

    I have a shader for all my rooms of the size below: nightCycleSurf = surface_create(8192, 8192); But it causes lag, so how can I make the surface to be just the size of view[0] (which is variable of size and position in the room)? I just copied all the shader data from a youtube tutorial so I...
  18. D

    How to update part of a buffer with part of a surface

    I am new to this forum, so hello to everyone. English is not my native language, so forgive if you sometimes find it strange what I write. I am programming a game where players can modify the level (a sprite) in a way similar to what lemmings (the classic game from 1991) do while they dig. I...
  19. M

    Game closes when trying to draw a surface

    I did a light system some weeks ago, and it worked, now that i changed my pc, game closes when i try to draw a surface, it doesn't even give a error log
  20. Le Slo

    GMS 2 Anti aliasing with the wrong color

    Hi! After a couple of years coding with game maker, I usually end up having issues with the drawing part, getting blurry edges with the wrong color or how to deal with anti aliasing in general. During that time I learned a lot of little things on how to draw properly (rounding positions...