Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3509 Members - Latest Member: lioneltenel

27. May 2012, 03:35:17 am
Xith3D CommunityGeneral CategoryNews (Moderators: Marvin Fröhlich, 'n ddrylliog)New NumberWidget
Pages: [1]
Print
Author Topic: New NumberWidget  (Read 1035 times)
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« on: 20. April 2008, 10:55:08 pm »

I have add a new Widget to the HUD's standard Widgets family. It is the NumberLabel, which is designed to render (dynamic) numbers in the most high performance way possible.

You can define the decimal-separator char and the number of fraction-digits.

In the near future I will modify the FPSCounter Widget to use/extend it, because it is twice as fast as the current FPSCounter implementation.

The NumberLabel is backed by a special Shape3D called NumberGeom, which is built of a TriangleStripArray with four vertices for each digit/sign/decimalpoint. Each time the value changes, the vertex coordinates and texture-coordinates are updated. If the used font is a monospace-font, the vertex-coordinates don't even need to be updated more than once. All unused vertices are disabled through the setValidVertexCount() setting.

Oh, and you have to define a maximum digit count, which is a forth of the number of available vertices. If the number is longer than the maximum number of digits, the most significant values ate cut off.

Marvin
« Last Edit: 21. April 2008, 09:39:45 am by Marvin Fröhlich » Logged
hawkwind
Getting respectable
***
Offline Offline

Posts: 363



View Profile Email
« Reply #1 on: 21. April 2008, 01:04:43 am »

nice!!
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic