Site Logo


Sparen's Danmakufu ph3 Tutorials - Function Reference (General Functions)

Introduction

Welcome to my local copy of the Touhou Danmakufu ph3 Function Reference, available in case the Danmakufu Wiki goes down *again*. Here you can access the entirety of the translated Danmakufu function reference, although it has passed through the Sparen filter and therefore may be slightly different from the Wiki.

As a reminder, the OFFICIAL JAPANESE DOCUMENTATION can be found at mkm's website.

If you are accessing this after the closure of GeoCities Japan in Spring 2019, the full Japanese docs have been backed up to GitHub. This link may be sufficient, but if you experience garbled text, you may need to change your browser's Text Encoding [Safari/Firefox: View -> Text Encoding -> Japanese (Shift JIS); Chrome 55+: Extension required]. Alternatively, download the documentation via the 'Clone or download' button.

In the tutorials, the functions will be available like so: add()

Obj Fxns and Player/System/Script functions are on their own respective pages to prevent this page from becoming too long. To access these, refer to the sidebar.

Notes on types:
mkm uses types such as 'real' (for real numbers and object IDs), 'char' (for characters and strings), and 'free' (wildcard). In my version of the documentation, I break this down by primary type (number/char/string/bool/free/etc) with a detailed type in parenthesis (float/int/path/Object ID). I also provide types for return values.

Math Functions

Text Functions

Path Functions

Time Functions

Debug Functions

Common Data Functions

Audio Functions

Input Functions

Key States:

KEY_FREE: the key is not pressed.
KEY_PUSH: the key has been pressed.
KEY_HOLD: the key is being held.
KEY_PULL: the key has been released.

Virtual Keys (built-in):

VK_LEFT (ID: 0) - Move left
VK_RIGHT (ID: 1) - Move right
VK_UP (ID: 2) - Move up
VK_DOWN (ID: 3) - Move down
VK_OK (ID: 4) - Confirm
VK_CANCEL (ID: 5) - Cancel
VK_SHOT (ID: 6) - Player Shot
VK_BOMB (ID: 7) - Player Spell/Bomb
VK_SPELL (ID: 7) (Alias for VK_BOMB)
VK_SLOWMOVE (ID: 8) - Focus
VK_USER1 (ID: 9) - User Key 1
VK_USER2 (ID: 10) - User Key 2
VK_PAUSE (ID: 11) - Pause

General Keys:

KEY_0 ... KEY_9: 0-9 Keys
KEY_A ... KEY_Z: A-Z Keys
KEY_F1 ... KEY_F10: F1-F10 Keys
KEY_MINUS: -
KEY_EQUALS: =
KEY_SLASH: /
KEY_BACK: Backspace
KEY_TAB: Tab
KEY_SPACE: Space
KEY_LBRACKET: [
KEY_RBRACKET: ]
KEY_SEMICOLON: ;
KEY_APOSTROPHE: '
KEY_GRAVE: `
KEY_BACKSLASH: \ Note: Refers to the key on Western keyboards.
KEY_YEN: \ Note: Refers to the key on Japanese keyboards.
KEY_AT: @
KEY_COLON: :
KEY_UNDERLINE: _
KEY_CIRCUMFLEX: ^
KEY_COMMA: ,
KEY_PERIOD: .
KEY_INSERT: Insert
KEY_DELETE: Delete
KEY_RETURN: Enter
KEY_LCONTROL: Left Ctrl key
KEY_RCONTROL: Right Ctrl key
KEY_LSHIFT: Left Shift
KEY_RSHIFT: Right Shift
KEY_LEFT: Left Arrow Key
KEY_RIGHT: Right Arrow Key
KEY_UP: Up Arrow Key
KEY_DOWN: Down Arrow Key
KEY_NUMPAD0 ... KEY_NUMPAD9: 0-9 on the Number Pad
KEY_ADD: Number Pad +
KEY_SUBTRACT: Number Pad -
KEY_MULTIPLY: Number Pad *
KEY_DIVIDE: Number Pad /
KEY_DECIMAL: Number Pad .
KEY_NUMPADEQUALS: Number Pad =
KEY_ESCAPE: Escape

Render Functions

3D Camera Functions

2D Camera Functions

Script Functions

System Functions

Player Functions

Enemy Functions

Shot Functions

Item Functions

Other Functions