Creating custom playfield switch window
Create Playfield image to use:
- Open the game in VP and take a screenshot of the editor with the playfield in view. You can do this with
Alt
+PrtScn
. - Open
Microsoft Paint
and paste in you screenshot of the editor. Get there with windows key and typing paint - Select the outer playfield and crop it in MsPaint
- Click resize by pixels, uncheck Maintain aspect ratio and set to
400 x 900
- Save this image into your game folder so Godot picks it up and you can assign this to window image.
res://assets/img
is a good place to put it.
Create custom Window
- Filter the Files to show
playfield
, you should seePlayfieldWindow
andplayfield_control
- Duplicate the
playfield_control.tscn
and name likeplayfield_control_mygamename.tscn
- Duplicate the
PlayfieldWindow.tscn
and name likePlayfieldWindowMyGame.tscn
- Now right click the duplicated files and move to
res://autoload
. Could be anywhere, but easy to put here and find. - Open your
PlayfieldWindowMyGame.tscn
and set the Scene underWindowPinGod
in the inspector to yourplayfield_control_mygamename.tscn
- In your custom
res://Machine.tscn
change the Switch Window to your new window. - You can load the game but the playfield is missing. Add a texture to
playfield_control_mygamename.tscn
in thePlayfieldTextureRect
- The texture size should be 400x900 but you can adjust the control and window if you need larger or smaller.
New Buttons
Open the Machine.tscn in a text editor so you can see your switches you’ve added to reference and copy names.
Now you can just duplicate a button and rename it to the switch name. Select a button and use Ctrl+D
and move it into position.
Some buttons are set not to toggle so they send on/off switch. Like slingshots and spinners are never held down.