Skip to the content.

Functions within sub-modules, you can find these modules below the main KiwiCursor

Go to home page

Table of Contents

KiwiDistance

Internal: No

Used as a replacement to MaxDistance’s weird way of handling distance, you can disable this distance hiding by turning KiwiDistance.Settings.Override off

Extra Notes

Gui:GetAttribute(“Kiwi_MaxDistance”)

Max distance, set this to your prefered distance, automatically sets this to Gui.MaxDistance, but if you create this attribute it will prefer it

Gui:GetAttribute(“Kiwi_CurrentDistance”)

Current distance from GUI, calculated from SurfaceGui - (FaceofGuiPosition - CameraPosition).Magnitude and BillboardGui - (BillboardWorldPosition - CameraPosition).Magnitude

Functions

KiwiDistance.AddSignal()

Private function for connecting .ConnectSurface() and .ConnectBillboard()

KiwiDistance.RemoveSignal()

Private function for removing Kiwi.ConnectSurface() and Kiwi.ConnectBillboard() connections

KiwiCollisions

Internal: No

Gui collisions handler for KiwiCursor

Functions

KiwiCollisions.GetGuiCorners()

Parameters: (Position: Vector2, Size: Vector2, Rotation: number)

Returns: {TopLeft: Vector2, BottomLeft: Vector2, TopRight: Vector2, BottomRight: Vector2}

Gets the corners of the specified area, contains code from @jaipack17 that has been cleaned up a bit

local InsetCorners = Kiwi.GetGuiCorners(AbsPos + (Vector2.one * AbsRadius), AbsSize - (Vector2.one * (AbsRadius*2)), Rotation)
local WithinInsetRadius = false
	
for i,v in pairs(InsetCorners) do
  local mag = (v - Position).Magnitude
  if mag < AbsRadius then WithinInsetRadius = true break end
end

KiwiCollisions.GuiIntersecting()

Parameters: (GuiObject: GuiObject, Position: Vector2)

Returns: Intersecting: boolean

Notes: Use Kiwi.GuiTouching() for a list of gui

If the provided GuiObject is intersecting with the provided position, accounts for UICorner and Rotation

print(
  GuiObject .. "is intersecting: " .. tostring(
    KiwiDistance.GuiIntersecting( GuiObject, Vector2.new( 200, 300 ) )
  )
)

KiwiCollisions.GuiTouching()

Parameters: (Parent: Instance, Position: Vector2)

Returns: {GuiObject}

Notes: Use Kiwi.GuiIntersecting() for a single object use

Returns a list of intersecting gui that are descendants of the parent

local Hits = KiwiCollisions.GuiTouching(Parent, GuiObject)
for index,value in pairs(Hits) do
  if value:IsA("GuiButton") then
      print("Hovering on button", value)
  end
end

KiwiCollisions.GetClosestCorners()

Parameters: (Corners: KiwiCollisions.GetGuiCorners(), Position: Vector2)

Returns: (Corners: )

Notes: Use KiwiCollisions.GetGuiCorners() to get the corners of a gui object

Returns the a sorted list based on distance to corner

KiwiCollisions.GetClosestEdge()

Parameters: (GuiObject: GuiObject, Position: Vector2)

Returns: "Top" | "Bottom" | "Right" | "Left"

Notes: Does not work with rotated objects, will remove the rotation of that object if used

Will return the closest edge/side of the GuiObject

KiwiCollisions.GuiPositionInCenter()

Parameters: (GuiObject: GuiObject, Position: Vector2, DistanceFromEdge: number)

Returns: (InCenter: boolean, OnCorner: string)

Notes: OnCorner will “” unless under 2x the DistanceFromEdge to a corner

Gets if the position is within center, depending on distance to edge

KiwiCommand

Internal: Yes

Handles commands, you can adjust the settings in the file, such as changing the KiwiCommand.Settings.Prefix or disabling commands

KiwiUtility

Internal: Yes

Handles internal scripts, also contains the attribution text sent in console

⚠️ Documentation for KiwiUtility is in the file for people wanting to use it