Editor BackDrop Objects

TextBox & Making Score Count

The Backdrop Tool BarBack Drop View of Editor


TextBox

TextBoxes are used to Display Text.

TextBox Button

First Lets Create a TextBox:If you don't have a table already opened File / New to open a new Table. Click on the TextBox button Move Cursor towards the Backdrop of the table you are buildingit should turn into a TextBox cursor, click this where you would like your TextBox placed. and you get a TextBox.

 

 

 

Note:It can be placed anywhere but, usually kept off the gray area which is the table.


Note: A New Table already comes with a TextBox, called ScoreText. But isn't scripted to do anything yet.

Now that we have a TextBox Created we can look at the TextBox Option Properties.

Click on options in the ToolBar and select the TextBox by clicking on it.

Doing this will show us the TextBox properties.

TextBox - Name for type of object you have selected.

Name - ScoreText The name of the TextBox, you can change this to whatever you want. Tip I usually name the TextBox to what it displays. ScoreText is a perfect name for displaying text. The name is used to address the object through the script.

-----Colors&Formatting

Transparent - Makes the Back Color invisible or Transparent.

Back Color - Change the color behind the Text.

Text Color - Changes the color of the Text.

Font - Opens a box to select the Font, Font Style & Size.

Alignment - Sets the text to Align Center, Left, Or Right, in the TextBox.

-----Position

X - Indicates the X position of the TextBox on table.

Y - Indicates the Y position of the TextBox on table.

Width - Changes the Width of the TextBox.

Height - Changes the Height of the TextBox.

-----State

Text- You can type any text in here. It will be displayed in the TextBox when table is played.

-----Misc

Timer Enabled - Unchecked is default. The Timer is off. He can be activated in the script and called by the procedure TextBoxName_Timer()

Timer Interval - If enabled will call TextBoxName_Timer() in the script .Unchecked is default.This option defines the time befor the procecedure is started 1000=1 second.

UserValue - This Variable is userdefined and can be use for wathever you want. I use it often as event flag in the script.

 


Selecting Font Opens up the Font Option's box. From here you can select the Font, Font Style & Size.


Notes:Fonts needs first being intsalled in the windows folder

The Sample box
(aperçu) shows a preview of the selected font.

Script: leave it as installed on your computer.


Using demo3scoretextbox.zip

Here is the basic script changes to go with the above Demo , for adding score and having it displayed in the TextBox. Script is Green so you know it's script.

In the beginning of the script we will add the next line.
Note:
the ' is a Rem & isn't read in the script. Use ' to leave notes in script.

Dim Score 'see sub addscore this is a variable meaning the number changes.

Note: Variables on the beginig of the scripts are global variables (Dim Var1). You can have acess from within all script, function or procedure.
Variable defined within a procedur or a function is just alive within the procedure it is defined. It mean it is not visible from an other procedure. The value is lost when you leave the procedure. This mean also you can use the same name in different procedure in the same script (for exemple variables for local loops i or j are often used).

Run the Table 1st, to see it adding the score & Then try this below if you don't understand Dim.

Dim declares Score as variable, Score is now a variable, meaning it changes, so when we Dim it it will be remembered & added to.Without it, Score will only display the last AddScore hit event to the TextBox Display. To show This & to understand better what I'm getting at, put a ' or rem in front of the Dim Score line. & Compile the Script. Now the Score won't add, it will just diplay the Score for the last AddScore that registered.

.

This is the Sub for adding the Score.
'************************** Adding Score

Sub AddScore(points) 'we also need to Dim Score in the beginning of script. all Variables should go in the beginning of script.
Score = Score + points ' This adds your score + the points in the (Brackets) when something is hit & it contains AddScore(#)
ScoreText.Text = FormatNumber(Score, 0, -1, 0, -1) 'this Displays the points added in scoretext.Text box on the backdrop
End Sub

'************************** Adding Score Ends here

Note:Check the Script for AddScore (50) or any AddScore (#) Bumpers Targets & SlingShots now have AddScore. The AddScore (#) is the amount being added & displayed in the TextBox. Besides the green script these were also added.

Editor - Learn the Basics of the Visual Pinball Editor. Menu Bar Functions - Importing Images & Sounds.

Table Options - Ball Color - This explains Table options, importing a ball image & Changing ball color.

Right Click Options - Explains All Right Clicking Options for All Objects.

Building a simple Sling Shot - Learn how to make a slingshot from scratch using a basic wall.

Decals - Explains Decal Options, & shows how to import an image for a decal. Pinball DemoDecal

Plungers & Kickers - How to use a Plungers & Kickers & a Simple Pinball Demo.

Walls & Targets - Explains Walls & Targets. Pinball Demo1

Lights Collections - Learn how to use lights in a collection using collection manager. Pinball DemoLights

Lights & Bumpers - Learning Light & Bumper States & Lights, Bumpers Option Bar.Pinball Demo2

Gate & Sound Events - Explains Gate options & how to use sound events in keyup & keydown.Pinball Demo2

TextBox & Making Score count - Shows you how to use TextBoxes & AddScore & Dim Score. Pinball Demo3.

Ramps - Explains Ramp Options & shows you how to build a simple Ramp. Pinball Demo4

Spinners - Explains Spinner Options & shows script to make a spinner work. Pinball Demo4

Triggers - Explains Trigger Options & shows script to make a Trigger work. Pinball Demo5

Timers - Explains Timer Options & shows script to make a Timer work. Pinball Demo6

Flippers - Explains Flipper Options & shows script to make a Flipper work. Pinball Demo7

EMReel - Shows you how to use EMReels. Pinball Demo8

Go Back to Main Page