game-developmenthaxehaxeflixelflixel

Make text stick to top of screen, even when moving camera


I am learning Haxe Flixel. I have a text that I want to stick to the top of the screen. I couldn't find anything in the API. How can I make a textObject stick even when camera centered around player is moving?

Similarly. How can I set up lower bounds of the screen, to make camera not have the radius around my player, and have the lower bound at the bottom of the screen?


Solution

  • Use scrollFactor

    object.scrollFactor.set(0, 0);
    

    https://snippets.haxeflixel.com/camera/scrollfactor/