// Find entities where vector2Var equals Vector2(1.0f, 2.0f)
Query.where { has(TestComponent.id) }
.filter { by(TestComponent.vector2VarData).isEqualTo(Vector2(1.0f, 2.0f)) }
// Find entities where vector2Var.x is greater than 0.5f
Query.where { has(TestComponent.id) }
.filter { by(TestComponent.vector2VarData).byX().greaterThan(0.5f) }
// Find entities where vector2Var.y is between 0.0f and 1.0f
Query.where { has(TestComponent.id)}
.filter { by(TestComponent.vector2VarData).byY().greaterThanOrEqualTo(0.0f) and
by(TestComponent.vector2VarData).byY().lessThanOrEqualTo(1.0f) }
class ByVector2FilterOperation(val attrId: Int, var propId: Int = 0, val filterBuilder: FilterBuilder)
ByVector2FilterOperation
(
attrId
,
propId
,
filterBuilder
)
:
ByVector2FilterOperation |
Signature
constructor(attrId: Int, propId: Int = 0, filterBuilder: FilterBuilder) Parameters
attrId:
Int
propId:
Int
filterBuilder:
FilterBuilder Returns |
attrId
:
Int
[Get] |
Signature
val attrId: Int |
filterBuilder
:
FilterBuilder [Get] |
Signature
val filterBuilder: FilterBuilder |
propId
:
Int
[Get][Set] |
Signature
var propId: Int |
byX
()
:
ByVector2FilterOperation |
Sets the filter to operate on the X component of the Vector2.
Signature
fun byX(): ByVector2FilterOperation |
byY
()
:
ByVector2FilterOperation |
Sets the filter to operate on the Y component of the Vector2.
Signature
fun byY(): ByVector2FilterOperation |
greaterThan
(
value
)
:
ByVector2FilterNode |
Creates a filter node representing a greater than condition with the given float value. This compares only the component specified by propId (X or Y). By default, the filter operates on the X component.
Signature
fun greaterThan(value: Float): ByVector2FilterNode Parameters
value:
Float
|
greaterThanOrEqualTo
(
value
)
:
ByVector2FilterNode |
Creates a filter node representing a greater than or equal to condition with the given float value. This compares only the component specified by propId (X or Y). By default, the filter operates on the X component.
Signature
fun greaterThanOrEqualTo(value: Float): ByVector2FilterNode Parameters
value:
Float
|
isEqualTo
(
value
)
:
ByVector2FilterNode |
Creates a filter node representing an equality condition with the given Vector2 value. This compares both x and y components of the vector.
Signature
fun isEqualTo(value: Vector2): ByVector2FilterNode Parameters
value:
Vector2 |
isEqualTo
(
value
)
:
ByVector2FilterNode |
Creates a filter node representing an equality condition with the given float value. This compares only the component specified by propId (X or Y). By default, the filter operates on the X component.
Signature
fun isEqualTo(value: Float): ByVector2FilterNode Parameters
value:
Float
|
lessThan
(
value
)
:
ByVector2FilterNode |
Creates a filter node representing a less than condition with the given float value. This compares only the component specified by propId (X or Y). By default, the filter operates on the X component.
Signature
fun lessThan(value: Float): ByVector2FilterNode Parameters
value:
Float
|
lessThanOrEqualTo
(
value
)
:
ByVector2FilterNode |
Creates a filter node representing a less than or equal to condition with the given float value. This compares only the component specified by propId (X or Y). By default, the filter operates on the X component.
Signature
fun lessThanOrEqualTo(value: Float): ByVector2FilterNode Parameters
value:
Float
|