CompassRose

From FlightGear wiki
Revision as of 19:25, 23 December 2018 by Jsb (talk | contribs) (Created page with "{{Note|Canvas draw is currently work in progress. You can test and improve it by downloading the CanvasDrawDev add-on. The canvas.draw library will hopefully be rea...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Note  Canvas draw is currently work in progress. You can test and improve it by downloading the CanvasDrawDev add-on. The canvas.draw library will hopefully be ready to use in FG version 2019.1


Introduction

Please have a look at Canvas draw library first.

CompassRose

draw()

draw(cgroup, radius, style=nil);

Draws a compass rose with given radius. Marks and text labels are drawn as defined in style. A default style will be used if style is not given.

Style

The style class for CompassRose, derived from canvas.draw.marksStyle.

new()

return a new style hash

var myStyle = canvas.CompassRose.Style.new();

setMarkCount(value)

value number of marks on compass rose, default: 36

setLabelCount(value)

value number of text labels on compass rose to generate from course degrees, default: 12

setLabelDivisor(value)

value divide course degrees by this value to create text label, default: 10

setFontSize(value)

value fontsize for labels

{Note|This should be changed to scale with the radius parameter of the draw function.}}