Skip to content
Erik Welander edited this page Aug 31, 2014 · 2 revisions

nClock allows you to create analog clocks.

Loading

To load the module, you should add a LoadModule line pointing to nClock in your LiteStep configuration.

LoadModule "$ModulesDir$nClock-0.7.dll"

Or, if you are using NetLoadModule

*NetLoadModule nClock-0.7

Make sure to load nCore before nClock, since nClock depends on the functionality exported by nCore.

Creating Clocks

You create a clock by using the *nClock command, like this:

*nClock ClockName

You can also create multiple clocks on a single line, like this:

 *nClock ClockOne ClockTwo ClockThree

Clock Configuration

The clock is a Window whose prefix is the name of the clock. Each clock has 3 hands: the HourHand, the MinuteHand, and the SecondHand.

24HourDial

Boolean. When this is set to True, the HourHand will make one lap every 24 hours, instead of every 12 hours.
Default Value: False

UpdateRate

Integer. Specifies how often the hands will move, in milliseconds.
Default Value: 1000

Hand Configuration

Each hand is a Brush, whose prefix is the name of the hand.

Length

Float. How long this hand is.
Default Value: 50.0

Offset

Float. Where the hand begins, relative to the center of the clock.
Default Value: 0.0

Thickness

Float. How thick the clock hand is.
Default Value: 3.0

SmoothMovement

Boolean. When this is set to true, this hand will move between clock ticks smoothly, rather than jumping to the closest clock tick.
Default Value: False

Sample Configuration

*nClock Clock
*nLabel ClockDot
Clock
{ 
  X 0
  Y 0
  Width 100
  Height 100
  Color Green

  ; Default updaterate is 1 second
  UpdateRate 500

  ; Switches to a 24hour dial
  ;24HourDial

  HourHand
  { 
    Color Black
    Length 40
    Thickness 4
    SmoothMovement
  }

  MinuteHand
  {
    Color Black
    Length 45
    Thickness 2
    SmoothMovement
  }

  SecondHand
  {
    Color Red
    Length 55
    Thickness 2
    Offset -10
  }

  Dot
  { 
    X $(@@Width - @Width)/2$
    Y $(@@Height - @Height)/2$
    Width 6
    Height 6
    CornerRadiusX $@Width$
    CornerRadiusY $@Height$
    Color Black
    Parent @@
  }
}