Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.corundumgames.util;
- import com.badlogic.gdx.graphics.g2d.Batch;
- import com.badlogic.gdx.graphics.g2d.NinePatch;
- import com.badlogic.gdx.graphics.g2d.TextureRegion;
- import com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable;
- import com.badlogic.gdx.scenes.scene2d.utils.NinePatchDrawable;
- public class CGNinePatchDrawable extends BaseDrawable {
- private NinePatchDrawable patch;
- public TextureRegion region;
- public int left;
- public int right;
- public int top;
- public int bottom;
- public CGNinePatchDrawable() {
- super();
- }
- @Override
- public void draw(Batch batch, float x, float y, float width, float height) {
- if (this.patch == null) {
- this.patch = new NinePatchDrawable(new NinePatch(region, left, right, top, bottom));
- }
- this.patch.draw(batch, x, y, width, height);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement