• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

surfaces

  1. G

    GML [Solved] Suggestions on how to create an "scratch-off ticket"-like effect

    Hello everyone! I want to create something like one of those "scratch off" tickets, where you uncover a portion of a graphic based on where the mouse is. I thought about using a surface to help create a mask, but since they are volatile, all the uncovered bits are lost when focus is lost. I...
  2. FrostyCat

    GML GML Joseki Series - DRY with Context Wrappers

    GML Joseki Series - DRY with Context Wrappers GM Version: GMS 2.3.0 and above Links: N/A Downloads: N/A Last Updated: 2023-07-29 Overview This article describes a pattern for wrapping frequently used setup-cleanup code pairs as reusable units. Problem: Repetitive Setup-Cleanup Pairs Some...
  3. T

    GML Possibility of masking objects using surfaces?

    Hi there. I just finished a game I've been working on for many, many years. During that time, I thought of a lot of ideas for puzzles and mechanics that didn't end up making the cut either due to time constraints or simply because they didn't fit the project. I'm now working on prototyping some...
  4. Itaisinger

    GameMaker copying the application surface for a pause screen gives weird results

    Hey. I've got a tutorial object that acts like a pause menu, it saves the application surface and then draws is as background, after disabling all instances. the problem is that some spesific draws just look weird after the copy, like they are drawn in some different blend mode or low alpha...
  5. Itaisinger

    GML do you need to free video_draw sufaces?

    Hey everyone. I'm using video draw() for a video playback, and then freeing the surface, like so: var _vid = video_draw(); //everything is working if(_vid[0] == 0) { draw_surface_stretched(_vid[1],0,0, GUI_W,GUI_H); }...
  6. MaxLos

    SOLVED Noob question about surface blending

    Hi, I have a noob question about surface blending. If I have two different surfaces with a semi-transparent shape being drawn on them, is it possible to make it so they don't blend together when they're overlapping each other? So for example in this gif the circular shadow is blending with the...
  7. David Lorenz

    SOLVED Lighting System using Surface, need to mask certain objects

    Hello, everyone! I have a very simple lighting system that uses Surfaces. if surface_exists(surf) { var cx = round(camera_get_view_x(view_camera[0])-2), cy = round(camera_get_view_y(view_camera[0])-2); surface_set_target(surf) draw_clear_alpha(c_black, 1)...
  8. G

    SOLVED Need help combining surfaces.

    So I want to do a simple visual effect by not clearing a surface and increasing its scale/position with each step, which sould result in a smear, but I have trouble drawing the application surface to another surface (if that is even the right way to do it). It all results in a black screen...
  9. David Lorenz

    Trouble with drawing Surfaces for Scrolling Menu

    Hello, everyone! I'm making a scrolling list inside a menu and bumped my head against my ignorance about Surfaces. First, I draw a group of sprites with a loop, considering that the position have to be set according to the menu's slider position "scrolling_y". for (var i = 0, yy = 0; i <...
  10. J

    GameMaker [SOLVED] Draw object to surface after destroyed

    I'm trying to take advantage of game maker's surface system; the player can shoot bullets out of a gun and the casings of the bullets to be drawn to a surface so there's no performance cost, but I cannot for the life of me find a tutorial or thread relating to objects being drawn after they are...
  11. Itaisinger

    GML surface_set_target taking 15 milliseconds to execute for some reason

    hi. I have a player object that uses sprite stacking for drawing. It worked fine, but recently I added on top of it a flash shader+surface system, and now my game doesnt reach 20 fps. When profiling, I saw that surface_set_target() takes 15 milliseconds to process for some reason. I've tried a...
  12. Japster

    GameMaker Help needed! - Transparency artefacts when grabbing the application_surface content?

    Hi guys! - hoping someone can help please? - I'm creating a track editor for my latest game idea, and on-screen, even zoomed in, it looks *beautiful* - exactly how I want it to look.... ie. However, when exported (via "surface_save"), I get the image pasted further below! (Note:- I actually...
  13. Pixel-Team

    Can't draw fractal noise filter to Surface

    Hi all. I've used surfaces successfully before, but now I'm stuck when it comes to drawing filters to surfaces. I tried assigning an effects later that uses the fractal noise filter to render to a custom surface, using: //room creation code layer_script_begin("NoiseLayer", layer_surface_set)...
  14. T

    how to get sprite index from a tileset?

    I can't find equivalent functions for tileset manipulation in code. I want to enumerate all tilesets and then find the sprite they reference. From sprite I want to programmatically create a new sprite with a single frame per tile for collision detection. I can fake tileset_exists by using...
  15. G

    HTML5 Application Surfaces in HTML5 can't be grabbed?

    I have this code which works to transfer the application surface to a shader, then draw a sprite with that shader. Works completely fine in windows but in HTML5 somehow it just, doesn't? It doesn't draw anything at all. If i swap surface_get_texture(application_surface); to...
  16. Hyperfire

    GameMaker Merge Sprites VIA Surfaces

    Hi there, i've been using GM since GM6 and still learning! I want to create a new sprite by combining sprites using surfaces. I've watched some YouTube videos on the subject but cant find exactly what I'm looking for. What I need to achieve is: ================= 1: Combine Different sprites in...
  17. Anixias

    GameMaker Suggestion: Implement this solution to fix unusual behavior involving surfaces and alpha.

    Hi, all. Although I made the switch to Godot a while back and no longer use GMS2, I still thought I'd leave one suggestion that plagued me for the entirety of my development with GMS2: Surfaces and alpha. If I am simply ignorant on how GMS2 handles rendering and this is not viable, please...
  18. P

    Legacy GM How to create particles under created surfaces?

    I'm fairly new to both surfaces and particle systems, so I'm not quite sure how best I should go about this. my game is a top down RPG that has stationary particle effects in certain areas to indicate heat/coldness. The particles themselves worked perfectly until I implamented the use of a...
  19. FoxyOfJungle

    Shaders Get UV coordinates to use with second Sampler2D texture??

    Hello! So I want to calculate the coordinates/uv of a secondary texture in a shader. (Skip the "Separate Texture Page" option). I've looked on SEVERAL websites and couldn't solve it! I already have the texture coordinates using texture_get_uvs() and I already pass it to the shader using...
  20. FoxyOfJungle

    [SOLVED!] Trying to set texture that is also bound as depth buffer - bailling

    GM Version: GMS 2022.1+ Target Platform: All Download: N/A Links: Surfaces Summary: This tutorial will teach you how to get rid of the "Trying to set texture that is also bound as depth buffer - bailing..." error when trying to manually draw graphics in the application. Attention: This topic...
Top