Importing all flixel packages

41 views
Skip to first unread message

Maxmillion McLaughlin

unread,
Jun 1, 2015, 1:47:02 AM6/1/15
to haxef...@googlegroups.com
Hi everyone, I'm relatively new to haxe and very new to haxeflixel. As I've been using haxe, I've noticed how annoying it is to import every class as you use them. Is there anyway to import all flixel clases? Something like:
import flixel.*
or a maybe import a custom package with all flixel packages imported already.

Sorry if this is an odd question, it just seems very time consuming to import every package as you go.

Gama11

unread,
Jun 1, 2015, 4:12:28 AM6/1/15
to haxef...@googlegroups.com, maxmillion...@gmail.com
It's possible using an include macro, but I would strongly advise against it since it will increase your build times significantly, especially on native targets (cpp, android..). If you use flixel-addons, you're also gonna need to compile Nape (another pretty huge library) with everything even if you don't need it.

Is it really that inconvenient to import classes? FlashDevelop auto-imports most things, what IDE are you using?

Thom Sip

unread,
Jun 1, 2015, 5:05:35 AM6/1/15
to haxef...@googlegroups.com, maxmillion...@gmail.com
What gamma said.

Say your typing
var sprite:FlxSprite

when you're typing this, autocomplete (or whatever it's called) shows a popup saying flixel.FlxSprite. If you press TAB when this popup is open. Flashdevelop automatically inserts:

import flixel.FlxSprite;

at the top of the class you're working in.

Gama11

unread,
Jun 1, 2015, 5:29:21 AM6/1/15
to haxef...@googlegroups.com, tho...@gmail.com, maxmillion...@gmail.com
Huh, I didn't even know that "Tab" works for auto-completion. I simply press Enter. :)
Reply all
Reply to author
Forward
0 new messages