npOsds plugin

About this plugin

The npOsds plugin allow you to show On Screen Display messages from your publications. Not only one message, but you can show lot of them, and controll every separatelly. You can set every message font, color, text alignment, position, location, timeout, etc.

A common example of use for a plugin like this as the volume information in some media players: this appear at the top of every Windows, like a progress bar, using this kind of On Screen Display messages. Enjoy this usefull plugin for NeoBook!

Thirparty

This plugin are imposible without the aid of this people:

Thanks a lot!

Plugin actions index

npOsdCreate

Create a new Osd message. In the result variable the plugin save the ID of the created Osd message. With this ID you can use another plugin actions in order to identify the appropiate message.

↑↑

npOsdDestroy

Destroy a Osd message. Provide the appropiate message ID (returned when you create a new message) in order to destroy the message. A destroyed message cannot be show again: but of course ever can be created if you need.

↑↑

npOsdText

Set the Osd message text. Provide the appropiate message ID to be show. Remember that ID is returned when you create a new Osd message.

↑↑

npOsdShow

Show an Osd message. Provide the appropiate message ID in order to be show. You get the ID when creating a new message. Note that an empty message can be show, but nothing is put in the screen, so, use the appropiate plugin action to set the message text.

↑↑

npOsdHide

Hide an Osd message. Provide the appropiate message ID in order to be hide. You get the ID when creating a new message.

↑↑

npOsdFont

Set the Osd message font. Use this action to set the font of an identified Osd message. Dont forget that the text color of the message can be set with other plugin action. With this action you set every other font properties except text color.

↑↑

npOsdColor

Set the Osd message foreground and brackground colors. Use this action to set the message foreground color and optionally the background color. Let the background color empty to set it transparent. Provide the appropiate message ID returned when you create the message. The color format is the same that NeoBook use natively: RGB values separated by commas.

↑↑

npOsdPosition

Set position of a Osd message. With this action you can set the X and Y screen cordinates of a message, providing X and Y values and the appropiate message ID. Remember that other plugin actions set the position with certain predefined values: top lef, right left, etc.

↑↑

npOsdLocation

Set the location (position) of the message in one of the predefined values. You need to provide the ID of a message, returned when creating, and one of the following availables values:

↑↑

npOsdAlignment

Set the text aligment of a message based in their ID. This is very usefull when a message text have multilines, for example. You can use one of these possible values:

↑↑

npOsdTimeout

Set the timeout of a Osd message. With this optional action you can set the message timeout based in the message ID. The value must be in milliseconds and, when the time is out, the message is automagically hide, but not destroyed. Also note that the message can be visible in order to set their timeout.

↑↑

npOsdIsVisible

Find if a message is visible based in the message ID. This action return in the result variable the value True if the message is visible, and False if the message is not visible.

↑↑

npOsdHideAll

Hide all visible Osd messages without the need of any action argument.

↑↑

npOsdShowAll

Show all created Osd messages without the need of any action argument.

↑↑

npOsdDestroyAll

Destroy all created Osd messages without the need of any action argument.

↑↑

npOsdMessages

Retrieve all created Osd messages IDs. The result variable contain an Array with every available message ID. You can iterate this array using the common NeoBook Array actions.

↑↑

npOnOsdTimeout

Set a subroutine to be executed when a Osd message timeout is reached. Provide a message ID variable name to store the ID of the Osd message that as reached their timeout.

↑↑

Action errors subroutine

All the NeoPlugins deal with errors in the same way that NeoBook does: when the plugin found an action error the [LastError] variable store information about the error, so you can take care about this variable when execute an action.

But all the NeoPlugins also incorporate an advanced way to deal with possible action errors. You can define a subroutine named OnNeoPluginActionError in order to be executed when some action error are found and you can use this variables inside:

Note that this error handling subroutine are shared for all the NeoPlugins, so you no need to specify a subroutine for every plugin you use in your publication because the same subroutine are recognized and automagically used by every NeoPlugin. Below you can view a sample of this subroutine code:

:OnNeoPluginActionError
  AlertBox "NeoPlugin Error" "Error [LastError] in plugin: [PluginName]"
Return

Also note that the use of this NeoPlugins error handling subroutine is completelly optional. You can continue using the [LastError] variable as usual and even use the both methods at the same time.

↑↑