Skip to content

Proper way of using Scene & Game<Scene> and using ttf font #149

Answered by LeHaine
Its-Kenta asked this question in Q&A
Discussion options

You must be logged in to vote

Hey!

Th Game class is an optional class that contains a bunch of tidbits for handling and changing scenes. The Game class is completely optional and does not have to be used.

The main entry point should be Game correct?

As mentioned above it is completely optional. The only thing that needs to be passed in when creating the app is a ContextListener. The Game class is a ContextListener.

Normal Scene can't load assets (if I understand correctly), that means I have to load all of my assets in the main entry point and not the scenes respectively?

Not necessarily. A Scene has a reference to the Context when it's created. With Context we can access the resourcesVfs: VfsFile which we can use…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Its-Kenta
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants