How to use enableClipping() and disableClipping()

I was trying to clip a text in my LightningJS project and I didn’t understand how to use it. Can anyone help me with an example code? The documentation doesn’t have enough info on that.

You can play with it here:

https://lightningjs.io/playground/#N4IgJgpgDhB2mwMYEsIGcQC5QAEA2yA5gBYAusyshAVmgPSID2AThFiGaVGpnQ2LAB0aANYBPKAENEIwZABudfETIUqtBizYAaEMpLlKNemjAj2nbr35DRE6bIVKCBtcbqmROACyCAHIIAzCAAvrpoiMzIUKQY2CB4kgCuSMSCtFigAGbIeGyYCcmp6Ri6TJDsyAC2UCykAAQAglBQ9VnMjFX1AOSCdM1QJd0A3AA6sONMsGgNjDHIjNP1ALz1wDOShBCYawDuOwCcAGwADNr1xDsArN5n9Yh5kswAwox4LDsnAB4nv3+-IRCYyQixm9UkLRW9VgEF2TRaAAo5qQFtMAJTAsCMRBJKpwUiCABGjDAYkEEJg8GexFyYARFOEpE2EEEW1Iz0ksHkkjQCLRGJAukglIQKHQWAA2iA+gMSiAALphEAACQgeHeAHUWHgwHL4jk8uxVerGFrmDq5WUSfkQNVaswGgAZFSGKhtDpdbr6VRGDRMVgjcbjCBfe0NSBZZJ4BoPHloerGzXasD1EOkOBgePO1xGQSvGqLfFrcb1Uv1DYoxD1AD66ZqiXTfOLsDLrfqrFISWYLeAJbb-de8ggzB2vdg+3qR1u2nGl3q3gATAB2Gctsvpr6d1ijvut0gSbb1bM+qiCDdb9CCACSVWZABU012IOc0MxEDtupYeHwklB3pJdV2ZARGqCAwGQSRBBYQg6CAkCYHAyRNCqKpQToUhiFxQk6G8HDAjoZ4knTassUIdIoBgqcTigL4AFpCOI0jyMIboQnGNi137DjWw43cazgSRCTyJsx37eoMOQNAz02BFukHYdujRM9H1YQQBKEiBngIFojARABGX5zj0q47kCQz6jMk4MT4jiQkFcBoAzOAxTiKVvVddx-TYRVdFlDJ9VyG0-NKEByhtO06iPF03HdToenctw-S0QMJgoAsHQTNUk3NFN2ji3o6ETU1kyGYFg1DSKIyjGNEjQeMBlTTcMyzaLcwGAhEEkFFFmbVsK2QKtawgesuogES+NbDsux7CaxKKs0dVHfcYB2ebk24sSNtLWz7OFJykFQVy9BcE9PK0ey+jWnK5UVJUmUJOIQEkdVQiAA

resizeMode also uses clipping under the hood.

1 Like