HaxeFlixel / flixel

Free, cross-platform 2D game engine powered by Haxe and OpenFL
https://haxeflixel.com/
MIT License
1.99k stars 439 forks source link

flixel.#FlxG has no field fullscreen #722

Closed ghost closed 10 years ago

ghost commented 10 years ago

I'm trying to use toggle fullscreen using the code sample in the docs:

if(FlxG.keys.justReleased.F) {
    FlxG.fullscreen = !FlxG.fullscreen;
}

But whenever I try and do that, I get these compile errors

flixel.#FlxG has no field fullscreen

I'm using Flixel 3.0.1, Haxe 3.0.1, and OpenFL 1.2.1.

Thank you!

Gama11 commented 10 years ago

Wasn't really able to reproduce this.. What target?

ghost commented 10 years ago

I got the error on both C++ (Linux 32) and Neko. Both were debugged from Sublime Text Haxe openfl build system. Running Arch Linux 32.

Gama11 commented 10 years ago

I just installed flixel from haxelib... Fullscreen support for cpp targets was only recently added, before it was flash-only (I was looking at our master branch before, which should be the same as 3.0.1, but some changes have been made to it still it sees).

FlxG.fullscreen is not compiled in cpp:

#if flash
/**
 * Use this to toggle between fullscreen and normal mode.
 */
static public var fullscreen(default, set):Bool = false;

static private function set_fullscreen(Value:Bool):Bool
{
    if (Value)
    {
        stage.displayState = StageDisplayState.FULL_SCREEN;
        camera.x = (stage.fullScreenWidth - width * camera.zoom) / 2;
        camera.y = (stage.fullScreenHeight - height * camera.zoom) / 2;
        }
    else
    {
        stage.displayState = StageDisplayState.NORMAL;
    }

    return Value;
}
#end

If you want to use it for cpp targets, install the dev branch via haxelib git flixel https://github.com/HaxeFlixel/flixel.

ghost commented 10 years ago

Ah, thanks. I hadn't realized I was that far behind

Gama11 commented 10 years ago

Not far behind at all, 3.0.1 / the haxelib version wasn't released too long ago!