Class ScrollingTextureType
java.lang.Object
com.supermartijn642.fusion.texture.types.scrolling.ScrollingTextureType
- All Implemented Interfaces:
TextureType<ScrollingTextureData>,Serializer<ScrollingTextureData>
Created 28/04/2023 by SuperMartijn642
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.client.renderer.texture.TextureAtlasSpritecreateSprite(SpriteCreationContext context, ScrollingTextureData data) Creates the sprite from the custom texture data.deserialize(com.google.gson.JsonObject json) Deserializes the given json to some data.getFrameSize(SpritePreparationContext context, ScrollingTextureData data) Gets the size of a single frame.com.google.gson.JsonObjectSerializes the given data to json.
-
Constructor Details
-
ScrollingTextureType
public ScrollingTextureType()
-
-
Method Details
-
deserialize
public ScrollingTextureData deserialize(com.google.gson.JsonObject json) throws com.google.gson.JsonParseException Description copied from interface:SerializerDeserializes the given json to some data.- Specified by:
deserializein interfaceSerializer<ScrollingTextureData>- Throws:
com.google.gson.JsonParseException- if the given json does not match the expected format
-
serialize
Description copied from interface:SerializerSerializes the given data to json.- Specified by:
serializein interfaceSerializer<ScrollingTextureData>
-
getFrameSize
public Pair<Integer,Integer> getFrameSize(SpritePreparationContext context, ScrollingTextureData data) Description copied from interface:TextureTypeGets the size of a single frame. The returned size will be allocated in the relevant atlas.- Specified by:
getFrameSizein interfaceTextureType<ScrollingTextureData>- Parameters:
context- context for calculating the frame sizedata- custom texture data- Returns:
- the size to allocate to this sprite in the atlas
- See Also:
-
createSprite
public net.minecraft.client.renderer.texture.TextureAtlasSprite createSprite(SpriteCreationContext context, ScrollingTextureData data) Description copied from interface:TextureTypeCreates the sprite from the custom texture data.- Specified by:
createSpritein interfaceTextureType<ScrollingTextureData>- Parameters:
context- context for creating the spritedata- custom texture data- See Also:
-