When creating a new texture, drawing into said texture, then drawing a clipped version of that texture to the screen, the clipped texture is upside-down.
async function main() {
Momo.initialize("example", 768, 432);
let example_texture = await Momo.loadTexture("example.png");
Momo.clearToColor(Momo.makeColor(1, 1, 1));
let w = Momo.getTextureWidth(example_texture);
let h = Momo.getTextureHeight(example_texture);
Momo.drawTexture(example_texture, 0, 0);
Momo.drawClippedTexture(example_texture, w / 2, h / 2, w / 2, h / 2, 0, h);
let new_texture = Momo.createTexture(w, h);
Momo.setTargetTexture(new_texture);
Momo.drawTexture(example_texture, 0, 0);
Momo.setTargetTexture(Momo.getDefaultTexture());
Momo.drawTexture(new_texture, w * 2, 0);
Momo.drawClippedTexture(new_texture, w / 2, h / 2, w / 2, h / 2, w * 2, h);
}
Momo.setEntryPoint(main);
From the above, when drawing example_texture normally and clipped, the texture appears right-side up, as expected. Likewise, when normally drawing new_texture, it is also right-side up. However, when drawing a clipped version of new_texture, it is upside-down.
When creating a new texture, drawing into said texture, then drawing a clipped version of that texture to the screen, the clipped texture is upside-down.
From the above, when drawing
example_texture
normally and clipped, the texture appears right-side up, as expected. Likewise, when normally drawingnew_texture
, it is also right-side up. However, when drawing a clipped version ofnew_texture
, it is upside-down.