-
Notifications
You must be signed in to change notification settings - Fork 0
Config Variables
In Pulp there is a config variable which can be used to override some of Pulp’s default behaviors in the game script. For Cotton we have a file called config.lua
where we configure all those variables.
config.autoAct = true
Controls whether the Player automatically interacts with sprites. The default value is true
. When set to false
you can use the act function to interact with the sprite or collect the item directly in front of the Player (usually from the Player’s confirm event handler).
config.inputRepeat = true
Controls whether button events fire repeatedly while held. The default value is true
. When set to false
button events only fire once when first pressed. (UI will never repeat)
config.inputRepeatBetween = 0.2
Controls the time between all subsequent repeats.
config.cameraFollow = false
Controls whether the camera follows the Player. The default value is false
. When set to true
the Player is drawn in the center of the screen and all other tiles are drawn relative to its centered position.
config.cameraFollowOffsetX = 12
config.cameraFollowOffsetY = 7
Controls the offset of the “center” of the screen. The default coordinates are the middle of the screen, 0
,0
.
config.cameraFollowLockX = false,
config.cameraFollowLockY = false,
Controls which axises should be locked when cameraFollow
is active. By default both axises are used.
config.cameraFollowOverflowColor = "black"
Controls which color is drawn beyond the room’s borders when the camera is following the Player. The default is black
.
config.cameraFollowOverflowImage = nil
Controls if an image is drawn beyond the room’s borders when the camera is following the Player. The default is nil
. But can be set to any image in the Images
folder by adding Images/<yourimagename>
as value.
The custom drawing functions are unaffected by the follow members (as they are primarily intended for stationary HUD elements). To offset the custom drawing functions subtract event.px
and add config.followCenterX
to the x
coordinate and subtract event.py
and add config.followCenterY
to the y
coordinate.
config.allowDismissRootMenu = `false`
Controls whether the menu at the bottom of a menu stack can be dismissed. The default value is false
. When set to true
the root menu can be dismissed by pressing the B button.
config.sayAdvanceDelay = 0.2
NOT-YET-SUPPORTED Controls the amount of time that must elapse before the player can advance or dismiss a text window. The default value is 0.2 seconds. This can help prevent the player from accidentally dismissing text before they have a chance to read it.
config.useFastLoader = false
Controls the usage of cached files. Levels will automatically be cached when the cache is not being used. The default value is false
. When set to true
the cached levels will be used. This will increase performance on actual device.
More information on using the fastLoader can be found here: How to cache levels
config.playerType = "grid"
Controls which type of player will spawn. The default value is grid
. Options are: grid
, topdown
, platformer
-
grid
means you are viewing the player from above, but locked to a grid. It can move freely in all directions but only to locations on the grid. (Pulp style) -
topdown
means you are viewing the player from above, but not locked to a grid. It can move freely in all directions. -
platformer
means you are viewing the player from the side with gravity, but not locked to a grid. It can move freely in all directions except from above and down. Moving up and down is affected by gravity.
More information on different player types can be found here Player Types
config.font = "Pulp"
Controls the font being used throughout the game. Fonts are read from the fonts
folder.
config.showFPS = false
Controls if the FPS counter is enabled. The default value is true
. When set to false
the FPS counter will not be rendered.
config.renderScale = 1
Controls the resolutation that is shown on screen. The default value is 1
and shows 400x240. When set to 2
; resolution is changed to 200x120.
interface.images.pages = "images/interface/16-16/pages-16-16.png",
Controls the path of the "pages" icon. By default the Pulp icon (in 16x16 pixels) is loaded.
But it can be changed to any icon you like.
Icon has to be 16x16 pixels on a renderScale of 1
.
Icon has to be 8x8 pixels on a renderScale of 2
.
interface.images.prompt = "images/interface/16-16/prompt-table-16-16.png",
Controls the path of the "prompt" icon. By default the Pulp icon (in 16x16 pixels) is loaded.
But it can be changed to any icon you like.
Icon has to be 16x16 pixels on a renderScale of 1
.
Icon has to be 8x8 pixels on a renderScale of 2
.
interface.images.cursorActive = "images/interface/16-16/cursor-active-16-16.png",
Controls the path of the "cursorActive" icon. By default the Pulp icon (in 16x16 pixels) is loaded.
But it can be changed to any icon you like.
Icon has to be 16x16 pixels on a renderScale of 1
.
Icon has to be 8x8 pixels on a renderScale of 2
.
interface.images.dialog = "images/interface/16-16/dialog-20-20"
Controls the path of the image used for the "dialog" border and background. By default the Pulp border (in 20x20 pixels) is loaded.
But it can be changed to any icon you like.
Icon has to be 20x20 pixels on a renderScale of 1
.
Icon has to be 10x10 pixels on a renderScale of 2
.