Method TryGetSlice
TryGetSlice(string, out Slice?)
Returns the Slice element with the specified name from this TextureRegion.
public bool TryGetSlice(string name, out Slice? slice)
Parameters
name
stringThe name of the Slice element to locate.
slice
SliceWhen this method returns true, contains the Slice located; otherwise, null
Returns
- bool
true if the Slice was located; otherwise, false. This method returns false if this TextureRegion does not contain a Slice element with the specified name.
TryGetSlice<T>(string, out T?)
Returns the Slice element with the specified name from this TextureRegion as the type specified.
public bool TryGetSlice<T>(string name, out T? slice) where T : Slice
Parameters
name
stringThe name of the Slice element to locate.
slice
TWhen this method returns true, contains the Slice located; otherwise, null
Returns
- bool
true if the Slice was located; otherwise, false. This method returns false if this TextureRegion does not contain a Slice element with the specified name.