Android Open Source - YOGOSec Y Up Pixmap






From Project

Back to project page YOGOSec.

License

The source code is released under:

GNU Lesser General Public License

If you think the Android project YOGOSec listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package YOGOSec.core.render;
/*  ww  w  .  j  av a 2 s .  c om*/
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.g2d.Gdx2DPixmap;

/**
 * @author Aritz Lopez
 * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
 */
public class YUpPixmap extends Pixmap {

    public YUpPixmap(int width, int height, Format format) {
        super(width, height, format);
    }

    public YUpPixmap(byte[] encodedData, int offset, int len) {
        super(encodedData, offset, len);
    }

    public YUpPixmap(FileHandle file) {
        super(file);
    }

    public YUpPixmap(Gdx2DPixmap pixmap) {
        super(pixmap);
    }

    @Override
    public void drawLine(int x, int y, int x2, int y2) {
        super.drawLine(x, this.getHeight() - y, x2, this.getHeight() - y2);
    }

    @Override
    public void drawRectangle(int x, int y, int width, int height) {
        super.drawRectangle(x, this.getHeight() - y - height, width, height);
    }

    @Override
    public void fillRectangle(int x, int y, int width, int height) {
        super.fillRectangle(x, this.getHeight() - y - height, width, height);
    }

    @Override
    public void drawCircle(int x, int y, int radius) {
        super.drawCircle(x, this.getHeight() - y, radius);
    }

    @Override
    public void fillCircle(int x, int y, int radius) {
        super.fillCircle(x, this.getHeight() - y, radius);
    }

    @Override
    public void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3) {
        super.fillTriangle(x1, this.getHeight() - y1, x2, this.getHeight() - y2, x3, this.getHeight() - y3);
    }

    @Override
    public int getPixel(int x, int y) {
        return super.getPixel(x, this.getHeight() - y);
    }

    @Override
    public void drawPixel(int x, int y) {
        super.drawPixel(x, this.getHeight() - y);
    }

    @Override
    public void drawPixel(int x, int y, int color) {
        super.drawPixel(x, this.getHeight() - y, color);
    }
}




Java Source Code List

YOGOSec.android.GameActivity.java
YOGOSec.core.Game.java
YOGOSec.core.gui.Button.java
YOGOSec.core.gui.GUIComponent.java
YOGOSec.core.gui.GUI.java
YOGOSec.core.gui.IActionListener.java
YOGOSec.core.gui.InputListener.java
YOGOSec.core.gui.ProgressBar.java
YOGOSec.core.input.Input.java
YOGOSec.core.render.Render.java
YOGOSec.core.render.YUpPixmap.java
YOGOSec.core.screens.MainMenuScreen.java
YOGOSec.core.screens.MyScreen.java
YOGOSec.core.util.Point2f.java
YOGOSec.core.util.Point2i.java
YOGOSec.core.util.Point.java
YOGOSec.core.util.Rectangle.java
YOGOSec.core.util.Rectanglef.java
YOGOSec.core.util.Rectanglei.java
YOGOSec.java.GameDesktop.java