1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

GMS 2 problem with background layer tile code

Discussion in 'Programming' started by RichJ, Nov 10, 2019.

  1. RichJ

    RichJ Member

    Joined:
    Oct 31, 2019
    Posts:
    2
    I am able to make a background layer in code with a sprite but it doesn't tile in the game when I put the code in after creating the layer. It appears at the depth it's supposed to and I don't get any errors for when I run the game, it just doesn't show up tiled. I have it in the create event of a background manager object.

    This is what I have, I won't bore you with the whole array list, the first use corresponds to a layer depth the second to a sprite.

    layerid_7_1=layer_create(bg_1[6,2])
    layer_background_create(layerid_7_1,bg_1[6,0])
    bgid_7_1=layer_background_get_id(layerid_7_1)
    layer_background_htiled(bgid_7_1,true)
    layer_background_vtiled(bgid_7_1,true)
    layer_background_speed(bgid_7_1,-.5)

    From what I've read in the manual this should work but it the tiling effect isn't there. Can someone let me know what I'm doing wrong here?

    Thank you.
     
  2. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,984
    Your code looks good, so it might be a bug... If you can create a small project that only has this code and a background and it still does it then it's a bug and you should file it with YYG along with a link to the test project.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice