Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

Define custom chars in Delphi

Discussing issues that occur during plugin development.

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo

Post Reply
laesq
Posts: 1
Joined: June 18th, 2007, 5:03 pm

Define custom chars in Delphi

Post by laesq »

Hi,

I'm currently playing with creating my own plugin, nothing special yet, just getting used to how it all works.

I'm using delphi and so far have been quite successful. I've used the Delphi demo source available from the main lcd smartie site. It shows how to do basic things and as far as text output goes, all is well.

Now I want to define my own custom chars from within the plugin. The demo delphi source code doesn't show how to do this.

Can any one give me any help on this or point me to some sample code?

Cheers,

.: LaesQ :.

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Post by mattcro »

Apologies if this isn't what you're looking for...

If you mean that you want your plugin's output to contain custom chars, I think you can just include the standard customchar command in the output string, plus the relevant character code for that custom character, in the same way that you define and display a custom character in the Smartie screens config.

If I understand it correctly, Smartie parses the output of plugins for further plugin calls, including custom characters.

You'll need to make sure that you allow users to specify which custom char to use in case they already have custom characters elsewhere on the screen.

The kind of plugin function I'm thinking of here is something like displaying one of several predefined custom symbols so you don't have to worry about the rigmarole of defining custom characters, called like so:

Code: Select all

A CPU fan symbol in char slot 8: $dll(symbol,1,fan,8)
The plugin output would be something like:

Code: Select all

$CustomChar(8,0,25,11,4,26,19,0,0)$Chr(136)
and $dll(symbol,1,playing,1) would produce $CustomChar(1,16,24,28,30,28,24,16,0)$Chr(176)

You could collect a whole lot of useful symbols that fit in one (or maybe two) character spaces and make them into a symbol library in a plugin.

Post Reply