Unresolved Identifier

Hello,

I am trying to make a user interface for a main menu screen for a game using this code:

class Scene1 {
    static function main() {
        var button = new h2d.Bitmap(h2d.Tile.fromColor(0xEA8220, 128, 64), s2d);
    }
}

and VSCode yields this for s2d:

Unresolved identifier: [5, 76]

Is there a way to fix this? Thanks for the help.

Maybe I missed something but It looks you don’t have a proper reference for s2d.

If this is your main class than you have to implement the hxd.App like in examples.
In your case:

class Scene1 extends hxd.App {
    override function init() {
        var button = new h2d.Bitmap(h2d.Tile.fromColor(0xEA8220, 128, 64), s2d);
    }

    static function main() {
        new Scene1();
    }
}