Canvas

Struct Canvas 

Source
pub struct Canvas {
Show 19 fields pub m_Camera: PPtr, pub m_Enabled: u8, pub m_GameObject: PPtr, pub m_PixelPerfect: bool, pub m_RenderMode: i32, pub m_AdditionalShaderChannelsFlag: Option<i32>, pub m_Alpha: Option<f32>, pub m_Normals: Option<bool>, pub m_OverridePixelPerfect: Option<bool>, pub m_OverrideSorting: Option<bool>, pub m_PlaneDistance: Option<f32>, pub m_PositionUVs: Option<bool>, pub m_ReceivesEvents: Option<bool>, pub m_SortingBucketNormalizedSize: Option<f32>, pub m_SortingLayerID: Option<i64>, pub m_SortingOrder: Option<i16>, pub m_TargetDisplay: Option<i8>, pub m_UpdateRectTransformForStandalone: Option<i32>, pub m_VertexColorAlwaysGammaSpace: Option<bool>,
}
Expand description

Canvas is a class of the Unity engine since version 4.5.0. Exert from Unity’s scripting documentation: Element that can be used for screen rendering. Elements on a canvas are rendered AFTER Scene rendering, either from an attached camera or using overlay mode.

Fields§

§m_Camera: PPtr

PPtr<Camera>: (4.5.0 - 2022.3.2f1)

§m_Enabled: u8

Enabled Behaviours are Updated, disabled Behaviours are not.

§m_GameObject: PPtr

The game object this component is attached to. A component is always attached to a game object. PPtr<GameObject>: (4.5.0 - 2022.3.2f1)

§m_PixelPerfect: bool

Force elements in the canvas to be aligned with pixels. Only applies with renderMode is Screen Space.

§m_RenderMode: i32

Is the Canvas in World or Overlay mode?

§m_AdditionalShaderChannelsFlag: Option<i32>

i32: (5.6.0f1 - 2022.3.2f1)

§m_Alpha: Option<f32>

f32: (4.5.0 - 4.5.5)

§m_Normals: Option<bool>

bool: (4.5.0 - 4.5.5)

§m_OverridePixelPerfect: Option<bool>

Allows for nested canvases to override pixelPerfect settings inherited from parent canvases. bool: (4.6.0 - 2022.3.2f1)

§m_OverrideSorting: Option<bool>

Override the sorting of canvas. bool: (4.6.0 - 2022.3.2f1)

§m_PlaneDistance: Option<f32>

How far away from the camera is the Canvas generated. f32: (4.6.0 - 2022.3.2f1)

§m_PositionUVs: Option<bool>

bool: (4.5.0 - 4.5.5)

§m_ReceivesEvents: Option<bool>

bool: (4.6.0 - 2022.3.2f1)

§m_SortingBucketNormalizedSize: Option<f32>

f32: (5.3.4f1 - 2022.3.2f1)

§m_SortingLayerID: Option<i64>

Unique ID of the Canvas’ sorting layer. u32: (4.6.0 - 4.7.2); i32: (5.0.0f4 - 2022.3.2f1)

§m_SortingOrder: Option<i16>

Canvas’ order within a sorting layer. i16: (4.6.0 - 2022.3.2f1)

§m_TargetDisplay: Option<i8>

For Overlay mode, display index on which the UI canvas will appear. i8: (5.3.0f1 - 2022.3.2f1)

§m_UpdateRectTransformForStandalone: Option<i32>

Should the Canvas size be updated based on the render target when a manual Camera.Render call is performed. i32: (2022.1.0b1 - 2022.3.2f1)

§m_VertexColorAlwaysGammaSpace: Option<bool>

Should the Canvas vertex color always be in gamma space before passing to the UI shaders in linear color space work flow. bool: (2022.2.15f1 - 2022.3.2f1)

Trait Implementations§

Source§

impl Debug for Canvas

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Canvas

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Canvas

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Canvas

§

impl RefUnwindSafe for Canvas

§

impl Send for Canvas

§

impl Sync for Canvas

§

impl Unpin for Canvas

§

impl UnwindSafe for Canvas

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,