GHI_SetCursor

Pilus edited this page Aug 11, 2015 · 1 revision

Syntax:

GHI_SetCursor(cursorType, cursorDetail, onClearFunc, onOverlayClickFunc, ...)

Arguments:

GHI_SetCursor has 1 required argument and 3 optional argument.

cursorType
''String''
This is the texture for the cursor. Following is a list of available cursors:
NORMAL_CURSOR ATTACK_CURSOR ATTACK_ERROR_CURSOR BUY_CURSOR BUY_ERROR_CURSOR
CAST_CURSOR CAST_ERROR_CURSOR GATHER_CURSOR GATHER_ERROR_CURSOR INNKEEPER_CURSOR
INNKEEPER_ERROR_CURSOR INSPECT_CURSOR INSPECT_ERROR_CURSOR INTERACT_CURSOR INTERACT_ERROR_CURSOR
ITEM_CURSOR ITEM_ERROR_CURSOR LOCK_CURSOR LOCK_ERROR_CURSOR LOOT_ALL_CURSOR
LOOT_ALL_ERROR_CURSOR MAIL_CURSOR MAIL_ERROR_CURSOR MINE_CURSOR MINE_ERROR_CURSOR
PICKUP_CURSOR PICKUP_ERROR_CURSOR POINT_CURSOR POINT_ERROR_CURSOR QUEST_CURSOR
QUEST_ERROR_CURSOR REPAIRNPC_CURSOR REPAIRNPC_ERROR_CURSOR REPAIR_CURSOR REPAIR_ERROR_CURSOR
SKIN_ALLIANCE_CURSOR SKIN_ALLIANCE_ERROR_CURSOR SKIN_CURSOR SKIN_ERROR_CURSOR SKIN_HORDE_CURSOR
SKIN_HORDE_ERROR_CURSOR SPEAK_CURSOR SPEAK_ERROR_CURSOR TAXI_CURSOR TAXI_ERROR_CURSOR
TRAINER_CURSOR TRAINER_ERROR_CURSOR ITEM
cursorDetail
''String''
This is a special texture for the GHI Item cursor texture. It is an icon texture.
conClearFunc
''Function''
This is a function declared to happen if the user right clicks to clear the cursor.
onOverlayClickFunc
''Function''
This is a function to happen when the UI is clicked by the user while the cursor is active.

Example:

GHI_SetCursor("QUEST_CURSOR","",nil,function()

cursorX, cursorY = GetCursorPosition()

local round = function(numb,digits)

local shift = 10 ^ digits

return floor( numb*shift + 0.5 ) / shift

end

print("X: "..round(cursorX,0),"Y: "..round(cursorY,0))

mybutton = CreateFrame("Button","mybutton",UIParent,"UIPanelButtonTemplate")

mybutton:SetPoint("CENTER",UIParent,"BOTTOMLEFT",round(cursorX,0),round(cursorY,0))

mybutton:SetWidth(32)

mybutton:SetHeight(32)

mybutton:SetScript("OnClick",function() mybutton:Hide() end)

GHI_ClearCursor()

end

)

This script sets the cursor up to get the cursor position on click and create a button on the screen at that location. After the button is created, the cursor is cleared and returned to normal.

Button code borrowed from Wow Programming.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.