Rect2D

data class Rect2D(val x: Int, val y: Int, val width: Int, val height: Int) : Comparable<Rect2D>

用于表示一个矩形区域

Constructors

Link copied to clipboard
constructor(x: Int, y: Int, width: Int, height: Int)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open operator override fun compareTo(other: Rect2D): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

判断是否存在交集

Link copied to clipboard
fun intersect(that: Rect2D): Rect2D

与指定矩形求交集。

Link copied to clipboard
fun mapToEntity(entity: GEntity): Rect2D

将相对于地图的全局坐标映射到相对于实体的区域坐标

Properties

Link copied to clipboard
val bottom: Int

下边界

Link copied to clipboard
val height: Int
Link copied to clipboard
Link copied to clipboard
val right: Int

右边界

Link copied to clipboard
val width: Int
Link copied to clipboard
val x: Int
Link copied to clipboard
val y: Int