DE EN FR ES IT CZ
Zurück Nach oben

Action text too close to cursor / Action-Text zu nahe am Cursor

  • #1, by kloot 13 years ago Zitieren
    Hello, I'm wondering if there is a super simple solution for this...
    We're having our action text drawn next to the cursor per Visionaire's built in functionality. Our cursor is a bit bigger though, so it almost overlaps the text. Is there a way to offset the position of the text field a few pixels?
    Thanks!

    Deutsch:
    Hallo, wir lassen unseren Action-Text von Visionaires Standardfunktion neben den Cursor setzen. Allerdings ist unsere Cursorgrafik etwas größer, sodass sie den Text beinahe überlappt. Kann man das Textfeld irgendwie verschieben?
    Danke!
  • #2, by afrlme 13 years ago Zitieren
    hmm maybe with the registerHookFunction & getActionText? I've not actually used it for action texts before so the code block is a guess on my part - off the top of my head.
    local pos
    
    function aText(text)
     pos = text:getPoint(VTextPosition)
     text:setValue(VTextPosition, {x=pos.x + 50, y = pos.y})
     return true
    end
    
    registerHookFunction("getActionText", "aText")
    

    Like I said... I've not tested this at all & I usually only use the hookfunction for manipulating displayed text.

    * edit: doesn't work. sorry. I can't think of anything else off the top of my head at the minute either as I'm half asleep.
  • #3, by kloot 13 years ago Zitieren
    Hi ARFLme, thanks for your reply!
    After reading the wiki a bit, it seems to me that getActionText is actually designed to let you set the action text string for a given mouse position x & y? http://wiki.visionaire-tracker.net/wiki/RegisterHookFunction - seems like a misnomer and should be called setActionText... ?
    Anyway, if I can't access the action text textfield, and I can't use the above function to read out the current action text, is there another way to find out what the current action text is or to draw it somewhere?
    Thanks!
  • #4, by Alex 13 years ago Zitieren
    getActionText returns the displayed action text (must return a string value). It's called getActionText and not setActionText because it is a hook function - the engine calls this function to get the current action text.
  • #5, by afrlme 13 years ago Zitieren
    “
    Hi ARFLme, thanks for your reply!
    After reading the wiki a bit, it seems to me that getActionText is actually designed to let you set the action text string for a given mouse position x & y? http://wiki.visionaire-tracker.net/wiki/RegisterHookFunction - seems like a misnomer and should be called setActionText... ?
    Anyway, if I can't access the action text textfield, and I can't use the above function to read out the current action text, is there another way to find out what the current action text is or to draw it somewhere?
    Thanks!
    „


    Aye sorry mate, I was struggling with the generated syntax example/explanation of it - why I have been creating hand written versions of each function once I've tested them & can provide working examples. I've not gotten round to the registerHookFunction yet.

    I didn't see many options in the data structure in regards to action text anyway.

    @ Alex: could you provide a working example of what it would look like please?
  • #6, by Alex 13 years ago Zitieren
    I've added some examples for the registerHookFunction code, so the next time I upload the generated wiki documentation these examples will be included.

    here is the getActionText example:
    function myActionText(mousePos)
        -- individual action text: object name (in current language) of object below cursor, if there is no object then 'empty' is shown as action text
        local obj = game:getLink(VGameCurrentObject)
        if obj:getId().tableId == eObjects then
          return 'current object: ' .. obj:getTextStr(VObjectName)
        end
        return 'empty'
    end
    registerHookFunction("getActionText", "myActionText")
    
  • #7, by afrlme 13 years ago Zitieren
    Cheers Alex smile