---
tags:
    - "UI, Layout"
---

# Set Canvas Override Pixel Perfect

[UI](../../index.md) / [Layout](../index.md) / [Canvas](index.md) / **Set Canvas Override Pixel Perfect**

## Description

Sets the Override Pixel Perfect property of Canvas component

## Parameters

| Name | Description |
| :--- | :---------- |
| Canvas |  |
| Value |  |

## Code

```cs
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>

using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.UI;

namespace VisualScript.Runtime
{
    [Title("Set Canvas Override Pixel Perfect")]
    [Category("UI/Layout/Canvas/Override Pixel Perfect")]
    [Description("Sets the Override Pixel Perfect property of Canvas component")]
    
    [Image(typeof(IconCanvas), ColorTheme.Type.TextLight)]
    [Keywords("UI, Layout")]
    
    [Parameter("Canvas")]
    [Parameter("Value")]
    
    [Serializable]
    public class GenInstructionBool_Canvas_SetOverridePixelPerfect : Instruction
    {
        [SerializeField] private GetGameObject m_Canvas = new GetGameObject(
            new GenTypeGameObject_Canvas()
        );
        
        [SerializeField] private GetBool m_Value = new GetBool();
        
        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Override Pixel Perfect");
            return $"{this.m_Canvas} {member} = {this.m_Value}";
        }
        
        protected override Awaitable Run(Args args)
        {
            Canvas component = this.m_Canvas.Get<Canvas>(args);
            if (component == null) return Done;
            
            component.overridePixelPerfect = (bool) this.m_Value.Get(args);
            
            return Done;
        }
    }
}


```

