renamed particle* to animation*, added asesprite animation loading
This commit is contained in:
@@ -11,7 +11,6 @@ type TileSetSubRect struct {
|
||||
}
|
||||
|
||||
func Map2Subrect(raw map[string]any) *TileSetSubRect {
|
||||
|
||||
// we need to translate this map for less typing
|
||||
return &TileSetSubRect{
|
||||
W: int(raw["w"].(float64)),
|
||||
@@ -37,8 +36,25 @@ func GetPropertyRef(entity *ldtkgo.Entity) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func GetPropertyToggleTile(entity *ldtkgo.Entity) *TileSetSubRect {
|
||||
func GetPropertyString(entity *ldtkgo.Entity, property string) string {
|
||||
ref := entity.PropertyByIdentifier(property)
|
||||
if ref != nil {
|
||||
return ref.AsString()
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
func GetPropertyBool(entity *ldtkgo.Entity, property string) bool {
|
||||
ref := entity.PropertyByIdentifier(property)
|
||||
if ref != nil {
|
||||
return ref.AsBool()
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func GetPropertyToggleTile(entity *ldtkgo.Entity) *TileSetSubRect {
|
||||
ref := entity.PropertyByIdentifier(config.LDTK_Toggle_Tile)
|
||||
if ref != nil {
|
||||
return Map2Subrect(ref.AsMap())
|
||||
|
||||
Reference in New Issue
Block a user