Display*TextTo* natives

Status
Not open for further replies.
Level 19
Joined
Dec 12, 2010
Messages
2,074
this is applied for all text-referenced natives. Let's take the most common one for example.
JASS:
native DisplayTimedTextToPlayer   takes player toPlayer, real x, real y, real duration, string message returns nothing

real x/y - supposed to be x/y offset from the corner. Issue is, whole text panel being moved along with x/y given.

That means if I push note #1 with 0,0 offset and note#2 with 5,5 offset, note #1 will be moved to 5,5 position as well

attachment.php


code
JASS:
globals
 unit u
 real r1=0.0
 real r2=0.0
endglobals

function asdasd takes nothing returns nothing
call DisplayTimedTextToPlayer(GetLocalPlayer(),r1,r2,2.00,"Text #"+I2S(GetTriggerEvalCount(GetTriggeringTrigger())))
set r1=r1+0.1
set r2=r2+0.1
if r1>1 then
set r1=0
set r2=0
endif
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    local trigger t=CreateTrigger()
    set u=CreateUnit(Player(0),'Hblm',0,0,0)
    call TriggerAddAction(t,function asdasd)

    call TriggerRegisterTimerEvent(t,1,true)
endfunction

Old text shouldn't jump to the new position at all
 

Attachments

  • WC3ScrnShot_040716_201323_01.jpg
    WC3ScrnShot_040716_201323_01.jpg
    364.2 KB · Views: 219
  • DisplayTextIssue.w3x
    13.7 KB · Views: 103
Level 12
Joined
Mar 13, 2012
Messages
1,121
Old text shouldn't jump to the new position at all
If this is implemented then when a new text line is rendered all existing text has to jump a line up due to backwards compatibility. Which would make the native quite flawed.

Introducing a new native for rendering a floating text on the UI would be best.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Good point. Having some natives to display text at an offset without moving the entire text frame would be nice.
In the wish list I have worked out three possible alternatives which would allow UI customization and UI text rendering and involve a varying degree of work.
 
Status
Not open for further replies.
Top