Screen component access

Hi there,

its a bit weird, but i how do i access the ui screen component? i want to adjust the referenceResolution / scaleBlend during runtime or for initialization (thought i’ll try to create a dynamic mobile / desktop ui) but it doesnt work as adjusting an element component.

Thx!

this.entity.screen ?

this.entity.screen.referenceResolution and

this.entity.screen.scaleBlend should work.

Hi,

… I don’t know why, but I always got an error that the entity is null (I added it via attributes). Now I saw that the entity reference was removed after it is assigned to the attribute field (when parsing the script). I had to restart PlayCanvas. I don’t know - it sometimes happens that attribute references disappear immediately after being assigned in the editor - theyre showing up inside the field and disappear only after parsing the script - otherwise it looks everything is referenced correctly but its not - this behaviour caused the confusion about getting the screen component.

Thanks anyway!