1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

GM:S 1.4 [solved ]draw_rectangle_colour problem

Discussion in 'Programming' started by Shadowblitz16, Jun 27, 2016.

  1. Shadowblitz16

    Shadowblitz16 Member

    Joined:
    Jun 23, 2016
    Posts:
    601
    I have a small problem
    draw_rectangle_colour is drawing the boxes like they are not scaled with the view
    I thought thats what the draw_gui event was for?
    so that you can draw things without the view effecting them?

    am I wrong or is this a bug?

    here is a pic https://drive.google.com/open?id=0B16wNFPwi_2kaHdwUm5jcEtRUXc
     
  2. Jordan Robinson

    Jordan Robinson Member

    Joined:
    Jun 22, 2016
    Posts:
    86
    If you are scaling the view, you will have to scale the gui to match the new view size.

    Check out the manual for the gui functions.
     
  3. SoulTie

    SoulTie Guest

    Hmm. If you are not using the draw GUI event, then the box should be scaled for sure. Are you positive that the coords you entered are the ones that you are wanting? It could be a simple mistake that you are overlooking.
     
  4. Shadowblitz16

    Shadowblitz16 Member

    Joined:
    Jun 23, 2016
    Posts:
    601
    @Jordan Robinson I have no gui functions. you sure your not using a different export module?


    @SoulTie well it should at least have the lines correct shouldn't it?
     
  5. johnwo

    johnwo Member

    Joined:
    Jun 20, 2016
    Posts:
    240
    This is correct. All drawing done in the GUI Draw Event will be unaffected by the view(s).
     
  6. Shadowblitz16

    Shadowblitz16 Member

    Joined:
    Jun 23, 2016
    Posts:
    601
    I guess its a bug then? I wasn't using a draw_gui event
    can someone report this bug for me?
    I don't have an account on that mantis site yoyo games use
     
  7. Aura

    Aura Guest

    Please post the code that you're using instead of immediately running to conclusions.
     
    Jordan Robinson likes this.
  8. Shadowblitz16

    Shadowblitz16 Member

    Joined:
    Jun 23, 2016
    Posts:
    601
    I guess the size was a bug however it still draws tiny pixel lines

    Code:
    ///draw event
    if canDrawTiles draw_background(bg_tiles, 0, 0)
    if canDrawGrid draw_background(bg_base, 0, 0)
    
    draw_rectangle(0,0,8,8,true)
     
  9. Aura

    Aura Guest

    Please stop calling it a bug unless it has been classified as one. And please post the code that uses draw_rectangle_colour() because it could be a trivial mistake on your end.
     
    Jordan Robinson likes this.
  10. Shadowblitz16

    Shadowblitz16 Member

    Joined:
    Jun 23, 2016
    Posts:
    601
    Aura bugs are classified by us the users. well most of the time.
    also I meant the size was a bug in my code
    the lines should still be a pixel thick which they aren't

    Edit: this was the code I was using at the time of the screen shot.
    its not complete since I was actually trying to debug it.
    Code:
    ///draw_rect_custom(index, width, height, length, frames, frame)
    
    var index = argument[0];
    var length = argument[1];
    var frames = argument[2];
    var width = argument[3];
    var height = argument[4];
    var frame = argument[5];
    
    var X = index mod 32;
    var Y = index div 32;
    
    var XX = (X * width)
    var YY = (Y * height)
    var WW = width * 4
    var HH = height * 4
    
    //var FRAME = XX + 4 * YY
    
    var FRAME_X = XX mod length
    var FRAME_Y = YY div frames
    var FRAME_W = width * 4
    var FRAME_H = height * 4
    
    draw_rectangle_colour(XX, YY,  XX+width, YY+height, c_white, c_white, c_white, c_white, true)
    //draw_rectangle_colour(XX, YY, XX+width, YY+height, c_white, c_white, c_white, c_white, true)
    ///draw_background_part(sprite, FRAME_X, FRAME_Y, WW, HH, 0, 0)
     
    Last edited: Jun 27, 2016
  11. icuurd12b42

    icuurd12b42 TMC Founder GMC Elder

    Joined:
    Apr 22, 2016
    Posts:
    1,840
    the border is 1px thick.
    since the application surface is the same size of your screen by default drawing a line will be 1px thick in the final render
    scaling the view does not change this fact. you need to scale the surface to the size of the view in room
    And no it's not a bug, it's desired behavior.
    upload_2016-6-27_0-2-15.png
     
    Shadowblitz16 and ParodyKnaveBob like this.
  12. Shadowblitz16

    Shadowblitz16 Member

    Joined:
    Jun 23, 2016
    Posts:
    601

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