I would recommend determining your position and the size of the content as a percentage of the width and height of the screen. In the pseudo-haxe code (I'm learning Haxe / HaxeFlixel right now;)):
class Registry {
...
static var SCREEN_WIDTH;
static var SCREEN_HEIGHT;
...
static var X_UI_HUD_TITLE = 0.15;
static var Y_UI_HUD_TITLE = 0.05;
}
...
class HUD {
var title:FlxText;
public function new() {
title = new FlxText();
title.x = Registry.SCREEN_WIDTH * Registry.X_UI_HUD_TITLE;
title.y = Registry.SCREEN_HEIGHT * Registry.Y_UI_HUD_TITLE;
}
}
Thus, SCREEN_WIDTHthey SCREEN_HEIGHTcan change, but the text titlewill be in the same visible position.
source
share