![]() To register for callback use:ĬALLBACK_MANAGER:RegisterCallback("CustomCompassPins_MapChanged", function(zone, subzone) end) added callback "CustomCompassPins_MapChanged". changed update frequence from 10ms to 20ms. changed GetDistanceCoefficient function "auridon/auridon_base"):ĬALLBACK_MANAGER:RegisterCallback("CustomCompassPins_MapChanged", function(mapName) end) callback has now just one argument mapName (eg. :AddCustomPin method now checks if arguments are valid changed way to detect map change, it should be more efficient fixed bug where library could have loaded pins for different map fixed bug introduced in 1.22, map should be updated correctly now ![]() update from version 1.21 now should work correctly changed timing of WorldMap update, so shuttering when map is closed should be less noticeable removed a buggy background texture that would display behind the pin's real texture changed how pins are indexed, individual pins can now be deleted and accessed directly adding multiple pins with the same pinTag doesn't result in stuck pins anymore updated api version for those that use the lib as standalone updated api version and added IsLibrary tag fixed lua error that occurs on deadlands PTS Pin:GetNamedChild( "Background" ) returns the texture control. you can create some kind of highlighting effect with this. ![]() Pin:SetColor(r, g, b, a) changes the pins color. Pin:SetDimensions(width, height) sets the width and height of the pin (usefull if you want to implement your own a zoom effect near the border or something like that) Pin:SetHidden(bool) if bool is true, the pin is invisible Pin:SetAlpha(value) 1 = pin is opaque, 0 = pin is transparent. So in the previous example this function should call pin:SetColor(1,1,1,1) to make the pin white again.Īs the pin is the first given parameter in the layout callback functions, you can pass any data to these functions via the pinTag (eg an alternate texture that is different from the one specified in the layout table) As the pins are pooled (saved to be used again), the additional modifications of the pin need to be cleared again. The second function receives only a pin as parameter. eg: you could do something like pin:SetColor(1,0,0,1) to make the pin red. It can be used to implement additional visual effects. The first one receives the same parameters as the sizeCallback function. If no function is given, the pin has a size of 32x32 and will become smaller if abs(normalizedAngle) > 0.25ĪdditionalLayout another table with 2 components, each one needs to be a function. This function can modify the size of the pin via pin:SetDimension(width, height) SizeCallback a function which receives the pin, the angle between the player and the pin, the normalized angle (-1 = left border of the compass, 1 = right border of the compass, 0 = center of the compass), normalizedDistance (0 = same position as player, 1 = pin is at maxDistance) eg 2pi will result in the pin being always visible, pi means the pin is visible as long it is not behind the player. MaxDistance the maximal distance (in normalized map units) for the pin to be visible (it will slowly fade out, when the pin gets close to the maxDistance)įOV the field of view in radians. The layout table must have the following keys: XLoc, yLoc position of the pin in normalized map coordinates. You can pass additional attributes to the pin via the pinTag, which can later be used (see layout for more information). PinType the pinType the created pin belongs to The pinManager has only one method: CreatePin( pinType, pinTag, xLoc, yLoc ) Using this code the selected bar correctly display's its label - but the left and right bars are completely off. Label.new(x=time, y=high, text='Bar right', color=color.white, xloc=xloc.bar_time, yloc=yloc.abovebar) Add label above the bar to the right of the selected bar Label.new(x=time, y=high, text='Bar left', color=color.white, xloc=xloc.bar_time, yloc=yloc.abovebar) Add label above the bar to the left of the selected bar Label.new(x=start_time, y=high, text='Selected bar', color=color.white, xloc=xloc.bar_time, yloc=yloc.abovebar) ![]() Start_time = input.time(timestamp(""), "Start Calculation", confirm=true) This was just the first step so I can understand what I'm doing wrong. The reason for creating this code is to ultimately get the system to determine if the selected bar is a pivot and then based on that do other things. I've tried doing that in the code below but it still doesnt seem to work The issue I think is that input.time is not compatible with a simple +/-1 so I think it needs to be converted to a bar index.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |