Game Development Community

Bitmap buttons blurry after re-sizing screen

by Dennis Lamers · in Torque Game Engine · 05/28/2015 (3:28 am) · 2 replies

Hey all,

I've made a main menu with bitmap buttons. When ever I change the screen resolution of the game, the images become a little blurry/weird. They also move from position with one or two pixels.

All of the buttons have the same prefs as below in the code.
new GuiBitmapButtonTextCtrl(JoinButton) {
      canSaveDynamicFields = "0";
      Profile = "GuiButtonProfile";
      HorizSizing = "relative";
      VertSizing = "relative";
      position = "0 320";
      Extent = "300 70";
      MinExtent = "8 2";
      canSave = "1";
      Visible = "1";
      Command = "Canvas.SetContent("JoinServerGui");";
      hovertime = "1000";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "./menu/JoinButton";
   };

#1
05/28/2015 (7:48 am)
It is because the *Sizing fields are using a setting that resizes in addition to repositions the control whenever it's parent control is resized. To fix that you'll need to use a sizing option that does not grow/shrink the control but instead only repositions the control if you so desire like so:
HorizSizing = "left";
VertSizing = "top";

Options that do not dynamically resize the control on parent control resize:
  • For HorizSizing:
  • left
    center
    right

  • For VertSizing:
  • top
    center
    bottom
#2
05/28/2015 (10:41 am)
Thank you very much. What about if the resolution is changed to 800x600, do the buttons also shrink with it?