Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Tor (torbuntu)
@Torbuntu
The tmx file uses the LogoSprites.png
Thomas Cashman
@tomcashman
Hmm I wonder is it because you’re using new FileHandle instead of Gdx.files I’ll need to check what the code is doing
Tor (torbuntu)
@Torbuntu
Just tried with Gdx.files (a few options there) and the same result with each of them.
it keeps doubling the prefix on resolving the png for the tmx.
Thomas Cashman
@tomcashman
@Torbuntu think I found the issue, can you test beta.17 ?
Tor (torbuntu)
@Torbuntu
It works!! :D awesome. Thanks much!
sorry took so long to test.
Thomas Cashman
@tomcashman
No problem sorry it took so long to get the fix correct XD I was changing path lookups to support tilesets and object templates being in different directories from the map files
Tor (torbuntu)
@Torbuntu
That's actually really cool :D is that to help with the modding support for using internal map assets for mods?
Thomas Cashman
@tomcashman
No we had a lot of object templates and wanted to manage them in a separate folder from the maps since there’s around 200 maps
Tor (torbuntu)
@Torbuntu
Wow! That's amazing.
Tor (torbuntu)
@Torbuntu
Where did the name Mini2DX come from?
Thomas Cashman
@tomcashman
Well originally it was a re-implementation of Slick2D using LibGDX so the 2DX came from combining those. Then I just liked the word mini to describe how light the framework is to use
Tor (torbuntu)
@Torbuntu
That's kind of what I always assumed :D I love it!
How's the monogame stuff coming? Or is that still on the backlog for a while?
Thomas Cashman
@tomcashman
Monogame ain’t going well. Turns out IKVM.NET won’t work as a transpiler that produces code compatible with consoles. So now I have to implement my own transpiler.
Tor (torbuntu)
@Torbuntu
😱 oh no...
Does Haxe have any sort of way to convert java source projects to a cross platform executable? I've only briefly been made aware of that the other day, but it promises some huge things.
Tor (torbuntu)
@Torbuntu
Oh I'm dumb. Haxe compiles to a target from haxe, no transpiling
Tor (torbuntu)
@Torbuntu
Is there any plan to make Mini2DX a modular project to take advantage of the java 9+ module system for smaller deployments?
Thomas Cashman
@tomcashman
No plan at the moment. Need to learn the module system still XD
Tor (torbuntu)
@Torbuntu
Haha gotcha 🤣 I keep putting it off myself but reading about it gets me kind of excited for the implications.
But you've got so much on your plate already 😣
I'm super hyped about Mini2DX 2 though. The extended platform support highly peaks my interest.
Thomas Cashman
@tomcashman
I’ve so much work to do 😥
Tor (torbuntu)
@Torbuntu
You're still the only one working on this? (And alchemic cutie code besides)?
Thomas Cashman
@tomcashman
Yup. Though applied for a bank loan to get extra money to hire interns. Hopefully it gets approved
Tor (torbuntu)
@Torbuntu
Interns for the game or for Mini2DX?
Thomas Cashman
@tomcashman
Probably for the game so that I can focus on the Nintendo Switch port.
Since engine is mostly done
Tor (torbuntu)
@Torbuntu
That makes sense! I probably already asked but is the custom switch port stuff going to be in the main Mini2DX code too? So future users of Mini2DX could potentially also build for consoles?
Thomas Cashman
@tomcashman
Some of it will but the rest will be in a private repo due to NDAs
Tor (torbuntu)
@Torbuntu
That's right, I remember that now 😀
Thomas Cashman
@tomcashman
But I’m hoping to speak to Nintendo after launch to automatically grant access to Nintendo developers
Basically same set up as monogame
Tor (torbuntu)
@Torbuntu
That would be amazing.
Have you thought about making a community group on discord? It seems that has pretty good attraction for community members. At least from the ones I've found.
Like LibGDX and various linux and java groups. Constant activity there.
Thomas Cashman
@tomcashman
Hmmmm good idea
I’ll set one up later :)
Tor (torbuntu)
@Torbuntu
:D great!!
Thomas Cashman
@tomcashman
hey @/all I've set up a Discord server now for mini2Dx :) https://discord.gg/XfCutsH
Mateus Bandeira
@mateusbandeiraa

Hey guys, good evening!
I'm getting a weird behaviour trying to render a TiledMap. If I try to render it before anything else, it doesn't show up on the screen. I need to render something in advance for it to work. In example,

public void render(GameContainer gc, Graphics g) {
        tiledMap.draw(g, 32, 32);
    }

Shows a black screen.

But,

public void render(GameContainer gc, Graphics g) {
        g.drawCircle(0, 0, 5);
        tiledMap.draw(g, 32, 32);
    }

renders the circle and the map.

Is this a known issue?

Thomas Cashman
@tomcashman
Very strange. Can you paste the code where you create the map?
Mateus Bandeira
@mateusbandeiraa

I made some changes since my last message, but the issue persists. Actually, my code is very simple yet.

The main screen:

public class IndoorScreen extends BasicGameScreen {
    private GameMap tiledMap;

    // ...
    @Override
    public void initialise(GameContainer gc) {
        try {
            tiledMap = new GameMap(Gdx.files.internal("Maps/sample_indoor.tmx"));
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }

    @Override
    public void render(GameContainer gc, Graphics g) {
        g.drawCircle(0, 0, 5); // tiledMap won't render if this line is not present.
        tiledMap.render(gc, g);
    }
}

The GameMap class:

public class GameMap extends TiledMap {
    private int positionX = 0;
    private int positionY = 0;
    private float renderScale = 1.2f;

    // ...
    public void render(GameContainer gc, Graphics g) {
        g.scale(renderScale, renderScale);

        this.draw(g, positionX, positionY);

        g.scale(1, 1);
    }
}

Later I discovered that rendering something after tiledMap.draw() will make it work on the next render() call. In other words:

    // IndoorScreen class
    private int renderCalls = 0;
    @Override
    public void render(GameContainer gc, Graphics g) {
        tiledMap.render(gc, g);
        g.drawCircle(0, 0, 5); 
        System.out.println("renderCall: " + ++renderCalls);
    }
renderCall: 1 -> Just the circle.
renderCall: 2 -> Both circle and map.

This is not a huge problem for me, as I indeed need to render other objects. But It gave me a headache when the first thing I was trying to do was make the map show up on the screen.

Thomas Cashman
@tomcashman
hmm there must be a bug in the graphics flushing. I will investigate. Sorry for the issue, I'll let you know when fixed!
also, you can manually force a flush using g.flush() if needed though in general it's best not to do this since we try to batch everything
Mateus Bandeira
@mateusbandeiraa

I forgot to mention: I tried to flush() before and after the tiledMap.draw() call. Still no luck.

Sorry for the issue, I'll let you know when fixed!

No need to apologize. Your work is already amazing.

Thomas Cashman
@tomcashman
that's very bizarre! I'll investigate and try fix in a 1.9.1 update :)
Tor (torbuntu)
@Torbuntu
If it helps at all, I can in draw a map right after viewport.apply(g);