How to get Rect2 information

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By jujumumu

If a variable is a Rect2(a,b,c,d) how could I get the value of a or b or c or d using the variable? Thanks!

:bust_in_silhouette: Reply From: Ertain

From the looks of it, you can get them from the “pos” and “size” member variables. For example:

var foo = Rect2(a, b, c, d)

The members correspond to other variables like this:

foo.pos.x => a
foo.pos.y => b
foo.size.width => c
foo.size.height => d

Hope this helps.

Thanks! That was exactly what I needed.

jujumumu | 2019-07-31 00:23