- Joined
- Jul 18, 2010
- Messages
- 2,377
This is an example showing how to change the shown text in the lumber box at the top of the screen, using jass.
First we need to know how the frame showing the lumber text is called. It is called "ResourceBarLumberText".
After one knows the frames name, one gets access to it by using BlzGetFrameByName.
BlzGetFrameByName loads a frame using a string (name) and an integer (creationcontext).
After one got the frame one uses BlzFrameSetText on it, with the text wanted to be shown.
After using/calling ChangeLumberTextBox() your screen should look kinda like that.
One should use ChangeLumberTextBox() after map init finished.
As soon the local player needs to update the lumber text, your custom text will be lost.
One could also change the text shown in the other resourceboxes, By using a different name inside BlzGetFrameByName.
UI: Change Lumber Text
[JASS/AI] - UI: Create a TextButton
[JASS/AI] - UI: Positionate Frames (important)
UI: toc-Files
UI: Reading a FDF
UI - The concept of Parent-Frames
[JASS/AI] - UI: FrameEvents and FrameTypes
UI: Frames and Tooltips
[JASS/AI] - UI: Creating a Bar
UI - Simpleframes
UI: What are BACKDROPs?
UI: GLUEBUTTON
UI: TEXTAREA the scrolling Text Frame
UI: EditBox - Text Input
[JASS/AI] - UI: Creating a Cam control
UI: Showing 3 Multiboards
UI: OriginFrames
Default Names for BlzGetFrameByName (Access to Existing game-Frames)
[JASS/AI] - UI: List - Default MainFrames (built in CreateAble)
First we need to know how the frame showing the lumber text is called. It is called "ResourceBarLumberText".
After one knows the frames name, one gets access to it by using BlzGetFrameByName.
BlzGetFrameByName loads a frame using a string (name) and an integer (creationcontext).
After one got the frame one uses BlzFrameSetText on it, with the text wanted to be shown.
JASS:
function ChangeLumberTextBox takes nothing returns nothing
local framehandle fh = BlzGetFrameByName("ResourceBarLumberText" , 0) //Load "ResourceBarLumberText" with creationcontext 0
call BlzFrameSetText(fh , "Lumber") //Change the text to Lumber
set fh = null
endfunction
One should use ChangeLumberTextBox() after map init finished.
As soon the local player needs to update the lumber text, your custom text will be lost.
One could also change the text shown in the other resourceboxes, By using a different name inside BlzGetFrameByName.
- For Gold use: "ResourceBarGoldText"
- Lumber is named "ResourceBarLumberText"
- Food is "ResourceBarSupplyText"
- For the box showing the Upkeep level (no, low, high) use "ResourceBarUpkeepText"
Other UI-Frame Tutorials
The following links might provide more insight into this subject.UI: Change Lumber Text
[JASS/AI] - UI: Create a TextButton
[JASS/AI] - UI: Positionate Frames (important)
UI: toc-Files
UI: Reading a FDF
UI - The concept of Parent-Frames
[JASS/AI] - UI: FrameEvents and FrameTypes
UI: Frames and Tooltips
[JASS/AI] - UI: Creating a Bar
UI - Simpleframes
UI: What are BACKDROPs?
UI: GLUEBUTTON
UI: TEXTAREA the scrolling Text Frame
UI: EditBox - Text Input
[JASS/AI] - UI: Creating a Cam control
UI: Showing 3 Multiboards
UI: OriginFrames
Default Names for BlzGetFrameByName (Access to Existing game-Frames)
[JASS/AI] - UI: List - Default MainFrames (built in CreateAble)
Attachments
Last edited: