HaxeFlixel / HaxeFlixel/flixel

Major jittering when scaling and rotating sprites

Open
#1,951 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haxe
Stars
2.2k
Forks
522
Avg merge
34m
Merged PRs (30d)
1

Description

  • Flixel version: github dev

Code snippet reproducing the issue:

package;

import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.text.FlxText;
import flixel.tweens.FlxTween;
import flixel.ui.FlxButton;
import flixel.math.FlxMath;

class MenuState extends FlxState
{
    override public function create():Void
    {
        FlxG.camera.pixelPerfectRender = true;
        super.create();
        var spr:FlxSprite = new FlxSprite();
        spr.x += 0.5;
        add(spr);
        spr.screenCenter();
        FlxTween.tween(spr.scale, {x: 3, y: 3}, 2, {type: FlxTween.PINGPONG});
    }

    override public function update(elapsed:Float):Void
    {
        super.update(elapsed);
    }
}

This seems to have been introduced in a very recent commit. I'm looking into it now. Sprites jitter around when scaling on rotating.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the provided MenuState reproduction with FlxG.camera.pixelPerfectRender enabled, focusing on the FlxSprite while its scale is tweened and it is rotated. Compare the observed motion with pixel-perfect rendering disabled if useful. Done means sprites no longer jitter during scaling and rotation.

Written by the indexing model from the issue text.

Assessment

Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.