Skip to content

v2.1

Choose a tag to compare

@iseahound iseahound released this 12 May 04:50
· 80 commits to main since this release
b1515cc

Breaking Changes

OnEvent("CanvasChange", callback) has been removed. Replace it with a combination of OnDraw(callback) and OnErase(callback)


Revamped the event system. 36 new event triggers are defined. Except for __Delete → OnDelete, all event triggers have identical names to their respective methods.

New Event

EventMoveWindowStorePosition - Saves the window position when the user drags it around (jsong55)

Shorthand

Shorthand syntax for OnEvent("MiddleMouseDown", callback) now becomes OnMiddleMouseDown(callback). Every event can now be called using shorthand syntax.

New Event Triggers

  • OnDelete - Called when the object is garbage collected
  • OnRemember
  • OnForget
  • OnDestroy - Called when TimeOut() and Destroy() is called
  • OnCreate - Called when the window is created or recreated after being destroyed
  • OnInvalidate
  • OnValidate
  • OnStop
  • OnStart
  • OnResume
  • OnUpdateLayered
  • OnHide
  • OnShow
  • OnScreenshot
  • OnFree
  • OnAllocate
  • OnErase
  • OnFill
  • OnRecycle
  • OnResolve
  • OnSave
  • OnClear
  • OnTimeout - Called when time is set in the styles causing the window to expire
  • OnFlush
  • OnPaint
  • OnDraw
  • OnRender - Called whenever the .Render() method is called
  • OnReallocate
  • OnRedraw
  • OnRerender - Called when the screen size, resolution, dpi, or orientation changes
  • OnWait
  • OnCooldown
  • OnSuspend
  • OnAnimate - Called whenever an animation happens, including FadeIn and FadeOut
  • OnFadeIn
  • OnFadeOut

Cooldowns and Animations have been modified to be more consistent.

  • FadeOut() can now be called before FadeIn()
  • Setting the time in the styles followed by Cooldown is now the same thing as Suspend(time)
    • TextRender().Draw("test 1", "m:10vmin c:Random t:2400").FadeIn(800).Cooldown().FadeOut(800)
    • TextRender().Draw("test 2", "m:10vmin c:Random").FadeIn(800).Suspend(2400).FadeOut(800)
  • Set the timestamp when the animation finishes enabling multiple Cooldown() or Wait()
    • TextRender().Draw("apple", "t:1000").FadeIn().Cooldown().FadeOut().Cooldown().FadeIn().Cooldown()