-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[M]Seperate tiled image into an new class
- Loading branch information
闫茂源
committed
Apr 11, 2024
1 parent
f91277b
commit 003d464
Showing
9 changed files
with
194 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package com.jme3.tmx.core; | ||
|
||
import com.jme3.material.Material; | ||
import com.jme3.texture.Texture2D; | ||
|
||
/** | ||
* When read a <image> element there 5 attribute there. This class is just a data struct to return the whole image node. | ||
* | ||
* @author yanmaoyuan | ||
*/ | ||
public class TiledImage { | ||
private final String source; | ||
private final String trans; | ||
// useless for jme3 | ||
private final String format; | ||
private final int width; | ||
private final int height; | ||
|
||
private Texture2D texture; | ||
private Material material; | ||
|
||
public TiledImage(String source, String trans, String format, int width, int height) { | ||
this.source = source; | ||
this.trans = trans; | ||
this.format = format; | ||
this.width = width; | ||
this.height = height; | ||
} | ||
|
||
public String getSource() { | ||
return source; | ||
} | ||
|
||
public String getTrans() { | ||
return trans; | ||
} | ||
|
||
public String getFormat() { | ||
return format; | ||
} | ||
|
||
public int getWidth() { | ||
return width; | ||
} | ||
|
||
public int getHeight() { | ||
return height; | ||
} | ||
|
||
public Texture2D getTexture() { | ||
return texture; | ||
} | ||
|
||
public void setTexture(Texture2D texture) { | ||
this.texture = texture; | ||
} | ||
|
||
public Material getMaterial() { | ||
return material; | ||
} | ||
|
||
public void setMaterial(Material material) { | ||
this.material = material; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.