You are browsing as a guest. Sign up (or log in) to start making projects!

2h 55m 17s logged

I did a bunch of backend stuff, adding features and making the engine overall better. My most recent addition to this is the use of a unified renderer component, where rather than having separate components handling the rendering of text, canvas sprites and normal sprites individually and with duplicate code, the main renderer component automatically finds any sprite type and renders it!

For example, in the scenes below: the text in past versions would have been rendered with a TextRenderer component, whereas now there is a TextSprite component that feeds a texture to a Renderer component on the object.

New Version

const text = new Phoenix.TextSprite("Hello world!", {fontSize: 32, backgroundColor: "#7fefcf", padding: 8});
app.addObject(app.createObject(
    new Phoenix.Transform(new Phoenix.Vector2(0, -83), 0, new Phoenix.Vector2(text.texture!.width, text.texture!.height)),
    text,
    new Phoenix.Renderer(1)
));

Old Version

app.addObject(app.createObject(
    new Phoenix.Transform(new Phoenix.Vector2(0, -83), 0, new Phoenix.Vector2(0,0)),
    new Phoenix.TextRenderer("Hello world!", {fontSize:32, backgroundColor: "#7fefcf", padding: 8}, 1)
0
4

Comments 0

No comments yet. Be the first!