mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Added textures for Blocks
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using GlitchyEngine.Math;
|
||||
|
||||
namespace Sandbox.VoxelFun
|
||||
{
|
||||
class BlockTexture
|
||||
{
|
||||
private String _fileName;
|
||||
|
||||
public String FileName => _fileName;
|
||||
|
||||
private Vector2 _atlasStart;
|
||||
private Vector2 _atlasSize;
|
||||
|
||||
[AllowAppend]
|
||||
public this(String fileName)
|
||||
{
|
||||
String str = append String(fileName);
|
||||
|
||||
_fileName = str;
|
||||
}
|
||||
|
||||
public Vector2 TransformTexCoords(Vector2 texCoords)
|
||||
{
|
||||
return _atlasStart + texCoords * _atlasSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user