Download Now
Forums

    Reference Codebot.Render.Scenes.pas

    Part of the Codebot Render package

    The Codebot.Render.Scenes unit gives you TScene, the base class of everything a host shows. You descend from TScene and override Initialize to load what your scene needs, Logic to update it once a frame, Render to draw it, and Finalize to free what you created. Calling inherited Render clears the scene for you. While your scene runs you have its Canvas, its default Font, Time, Width, Height, and Context.

    Input arrives through DoKeyDown, DoKeyUp, DoTextInput, DoMouseDown, DoMouseMove, DoMouseUp, and DoMouseWheel, each with an argument record you can mark as Handled. Key codes are the VK_ virtual key codes of Codebot.Platform.

    If your scene needs something to happen at a steady rate apart from drawing, such as physics, override StepInterval to return the seconds between steps and override Step. The host then calls Step on a step thread of its own. Step runs at the same time as Logic and Render, so protect any data they share.

    TSceneHost runs scenes and provides what they share: the canvas, a default font, the window, the clipboard, the timer, the frame rate, and vertical sync. The two hosts are TSceneController in the codebot_render_controls package and TApplication in the codebot_render_sdl package. A host also holds the AssetKey of your program, which Codebot.Render.Assets describes.

    Items 90 items

    NameKindLine
    SceneHostfunction137
    SceneLogicStepconstant221
    SetSceneHostprocedure139
    TMouseActionenum21
    maPressenum value21
    maMoveenum value21
    maReleaseenum value21
    TSceneclass145
    Createconstructor164
    Destroydestructor165
    DoKeyDownprocedure174
    DoKeyUpprocedure175
    DoMouseDownprocedure176
    DoMouseMoveprocedure177
    DoMouseUpprocedure178
    DoMouseWheelprocedure179
    DoTextInputprocedure180
    Finalizeprocedure187
    Initializeprocedure185
    KeyEventprocedure169
    Logicprocedure189
    MouseEventprocedure171
    Namefunction167
    Renderprocedure191
    Resizeprocedure161
    Stepprocedure199
    StepIntervalfunction195
    Updateprocedure183
    Animatedproperty201
    Canvasproperty207
    Contextproperty203
    Fontproperty208
    Heightproperty214
    Hostproperty205
    Timeproperty210
    Widthproperty212
    TSceneClassclassref218
    TSceneHostclass83
    FCanvasfield85
    FFontfield86
    FFrameRatefield89
    FMouseXfield90
    FMouseYfield91
    FTimefield88
    FTimerfield87
    FVSyncfield93
    FWindowfield92
    BuildDatfunction106
    GetAssetKeyfunction100
    GetClipboardfunction95
    GetVSyncfunction98
    SetAssetKeyprocedure101
    SetClipboardprocedure96
    SetVSyncprocedure99
    AssetKeyproperty132
    Canvasproperty109
    Clipboardproperty122
    Fontproperty111
    FrameRateproperty117
    MouseXproperty119
    MouseYproperty120
    Timeproperty115
    Timerproperty113
    VSyncproperty127
    Windowproperty124
    TSceneKeyArgsrecord26
    Handledfield33
    Keyfield28
    Repeatedfield32
    Shiftfield30
    TSceneKeyEventprocedural66
    TSceneMouseArgsrecord37
    Buttonfield39
    Handledfield44
    Shiftfield43
    Xfield41
    XRelfield41
    Yfield41
    YRelfield41
    TSceneMouseEventprocedural68
    TSceneTextArgsrecord59
    Handledfield62
    Textfield61
    TSceneWheelArgsrecord48
    Deltafield50
    Handledfield55
    Shiftfield54
    Xfield52
    Yfield52
    TShiftKeysset19