Question - D&D No way to draw a transformed sprite using alpha

Discussion in 'GameMaker Studio 2 Community Tech Support' started by TheSly, Jul 14, 2019 at 5:22 AM.

  1. TheSly

    TheSly Member

    Joined:
    Jan 16, 2017
    Posts:
    885
    I'm using drag and drop and trying to draw a sprite transformed with a custom alpha value, but the ability seems to be missing in DnD. Is this something that is not possible in DnD?

    A) This works:
    1/ This draws a sprite with alpha correctly, but not transformed.
    works1.png

    2/ As above, draws correctly.
    works2.png

    3/ As above.
    Only 5 attachments allowed, so no more images, but as with 1/, this works too.
    Set Draw Alpha
    Draw Sprite


    B) These do not work - they just draw the sprite at full alpha:
    1/
    does not work1.png

    2/
    does not work3.png

    3/ This one shouldn't work, as *the manual states* set_draw_alpha is not for sprites, but just noting I tried it. *Note afterwards I've tried with Draw Sprite and this does work then, but no transform functionality*.
    does not work2.png

    I would love to be corrected, so if you know how to do this please advise. If it's not possible it needs addressing by Yoyo Games, by adding an alpha section to the draw sprite transformed code block.
     
    Last edited: Jul 14, 2019 at 1:23 PM
  2. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,272
    Just tested this for you as I've never used DnD before.
    If you click the white box next to colour then you can set the alpha via a slider in there and that affects the drawing when using draw_sprite_transformed().

    set_draw_alpha() does work with sprites - it converts to draw_set_alpha() in regular GML - but it can be overidden, check the manual entry for that function for the specifics, including this part which seems to be the issue you are having because draw_sprite_ext() was using a value of 1 for alpha as it was not set by using the slider mentioned above.
     
  3. TheSly

    TheSly Member

    Joined:
    Jan 16, 2017
    Posts:
    885
    Thanks for taking your time to look, I appreciate it.

    I should of mentioned I did try that. What I should of clarified by custom alpha, was one using a variable to control it. Dragging it to a locked in value is not a solution for fading objects over time. As you probably noticed, "Draw Sprite Transformed" converts to draw_sprite_ext() in GML, and the alpha value is there obviously coming from the colour selector section. The alpha in the colour selector is used for the images alpha, and for the colours alpha. Not having the ability to use a variable for the alpha specifically though is the issue.

    I should also clarify where I got that information from. The manual entry for dnd for the set draw alpha code block states this:

    It doesn't mention sprites, as other draw descriptions do. I've modified my original post to clarify this.
     
    Last edited: Jul 14, 2019 at 7:15 AM
  4. TheSly

    TheSly Member

    Joined:
    Jan 16, 2017
    Posts:
    885
    I'd like a response from Yoyo on this please, as it seems this is a problem.

    As mentioned above this is the description from the manual for the GML draw_set_alpha()
    The code block Set Draw Alpha is shown in the live preview to be the function draw_set_alpha() as well, yet it's description from the DND manual is this:
    The Set Draw Alpha code block does not work when used with Draw Self or Draw Sprite Transformed, BUT it does work correctly with Draw Sprite, although this block has no transform arguments.

    From what I see, the manual needs correcting and Draw Sprite Transformed needs an alpha argument.
     
  5. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,272
    Ah sorry I didn't really mess with it too much, I don't use DnD.

    Hopefully someone more familar with how it's supposed to work can help out, but there aren't many experienced DnD users around so you might be better just filing a Bug Report and attaching your sample project and waiting for them to get back to you - remember they dont work weekends.
     
  6. TheSly

    TheSly Member

    Joined:
    Jan 16, 2017
    Posts:
    885
    rIKmAN likes this.

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