hiteshsuthar / rokon

Automatically exported from code.google.com/p/rokon
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Wrong scale #77

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. try to scale sprite by horizontal, only x (like health bar)

What is the expected output?

image resizes by x and y =\

What do you see instead?

What version of Rokon are you using?

1.1.1

Please provide any additional information below.

I'm investigate a problem and found solution

this is a source of DynamicObject:

public void updateVertexBuffer() {
        _vertexBuffer.position(0);

        _vertexBuffer.putFloat(_x + _offsetX);
        _vertexBuffer.putFloat(_y + _offsetY);

        _vertexBuffer.putFloat(_x + _offsetX + (_width * _scaleX));
        _vertexBuffer.putFloat(_y + _offsetY);

        _vertexBuffer.putFloat(_x + _offsetX);
        _vertexBuffer.putFloat(_y + _offsetX + (_height * _scaleY));

        _vertexBuffer.putFloat(_x + _offsetX + (_width * _scaleX));
        _vertexBuffer.putFloat(_y + _offsetX + (_height * _scaleY));

        _vertexBuffer.position(0);
    }

and this is fixed code:

public void updateVertexBuffer() {
        _vertexBuffer.position(0);

        _vertexBuffer.putFloat(_x + _offsetX);
        _vertexBuffer.putFloat(_y + _offsetY);

        _vertexBuffer.putFloat(_x + _offsetX + (_width * _scaleX));
        _vertexBuffer.putFloat(_y + _offsetY);

        _vertexBuffer.putFloat(_x + _offsetX );
        _vertexBuffer.putFloat(_y + _offsetY + (_height * _scaleY));

        _vertexBuffer.putFloat(_x + _offsetX + (_width * _scaleX));
        _vertexBuffer.putFloat(_y + _offsetY + (_height * _scaleY));

        _vertexBuffer.position(0);
    }

Original issue reported on code.google.com by cih.exe...@gmail.com on 17 May 2010 at 12:09

GoogleCodeExporter commented 8 years ago
Rokon 2 is on the way, all current Issues are obsolete

Original comment by rtaylor205@gmail.com on 24 May 2010 at 3:31