How change color of icon in this framе???

Level 7
Joined
Aug 26, 2016
Messages
139
JASS:
set gameUIR = BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0)
    set butR[1] = BlzCreateSimpleFrame("Button", gameUIR, 0)
    call BlzFrameSetTexture(BlzGetFrameByName("ButtonTexture", 0), "ReplaceableTextures\\CommandButtons\\BTNDoomMelee", 0, true)
    call BlzFrameSetAbsPoint(butR[1], FRAMEPOINT_CENTER, 0.20, 0.05)
 
JASS:
// From https://github.com/lep/jassdoc/blob/master/common.j
/**
SimpleFrames only.
@param color Four byte integer of the form 0xaarrggbb. You can also use `BlzConvertColor` to create such an integer.

@patch 1.31.0.11889

*/
native BlzFrameSetVertexColor                      takes framehandle frame, integer color returns nothing

call BlzFrameSetVertexColor(BlzGetFrameByName("ButtonTexture", 0), 0xff<red><green><blue>)
 
They're hex codes for each color respectively. Each color can accept values from 0 to 255 (or "00" to "ff" in hex).

So, if you want it to have a reddish tint, you'll go with the following:
call BlzFrameSetVertexColor(BlzGetFrameByName("ButtonTexture", 0), 0xffff0000)

If you want a different color, you'll have to look up its RGB color values or its hex code and
specify it in the format given above.

Just a rundown on hex digits (and their equivalent decimal values):
  • a = 10
  • b = 11
  • c = 12
  • d = 13
  • e = 14
  • f = 15
 
Top