Skip to content

Releases: iseahound/TextRender

v2.1.3

22 Jun 18:33
2d733d7

Choose a tag to compare

Fixes an issue where a static textrender object has the incorrect canvaswidth and canvasheight (caused by v2.1.2)

v2.1.2

22 Jun 14:13
74140c1

Choose a tag to compare

Fixes multi-monitor setups. A lot of people don't know about this but using the s parameter in the text styles allows one to specify the monitor it should be drawn on. For example, TextRender("hello", "screen:2 time:3seconds") will always draw on monitor 2 using its DPI scaling, width, and height. It's also possible to input an hMonitor value instead of the monitor number for compatibility with the Windows API. Somehow this behavior broke during the upgrade from TextRender v1 → v2, so this update addresses that.

v2.1.1

10 Jun 13:12
1353179

Choose a tag to compare

  • Fixes scaling on display change (broken by v2.1)
  • Add Restart() as a combination of Stop() and Start() to restart the timer
  • Fix middle click coordinates dissappearing after the first launch
  • Fix OnReallocate and OnUpdateLayered
  • Removed try blocks in event processing, allowing the user to diagnose failures

v2.1

12 May 04:50
b1515cc

Choose a tag to compare

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 __DeleteOnDelete, 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()

v2.0.1

07 May 18:52
77324ee

Choose a tag to compare

Updated examples and fixed incorrect proof of Reallocate()

For breaking changes see: https://github.com/iseahound/TextRender/releases/tag/v2.0

v2.0

06 May 03:51
df8ada3

Choose a tag to compare

Version 2.0 of TextRender represents a major milestone in the codebase. All bitmap, window, and recipe (pending layers) functions are now formally verified to be bug-free. This means that any combination of the functions such as Erase(), Render(), Clear()... will always end up in a valid recoverable state. This release introduces a multitude of smaller functions such as Cooldown() used to support the formal verification of bitmap, window, and recipe state. The user should notice increased stability, better quality of life, and better integration with WinExist(tr).

To the people who are happy using a stable text rendering library: You're appreciated! 🥳

To adjust to the breaking changes please:

  • Rename None to NoEvents
  • Rename Default to DefaultEvents
  • Rename Flush to Resolve
  • Rename FreeMemory to Free
  • Rename UpdateLayeredWindow to UpdateLayered
  • Rename ToggleVisible to ShowHide
  • Replace Fade(time_in, time_out) with .FadeIn(t).Wait().FadeOut(t)
  • Replace Sleep(t) with .Hide().Suspend(t)

Everything else should work as-is for now.


Window Functions

  • Changed __New() to no longer accept parameters for creating a window
  • Changed Create(title?, style?, styleEx?, parent?) to accept window parameters
  • Changed Destroy() to be recoverable, recreating the window if needed for future calls
  • Added Invalidate() to remove window coordinates from object
  • Added Validate() to add window coordinates to object
  • Added Start() to start any timers specified by the time style
  • Added Stop() and Resume() to stop and resume timers respectively

Bitmap Functions

  • Renamed LoadMemory to Allocate() and to accept a bitmap rectangle
  • Added Erase() to selectively zero the bitmap memory using canvas coordinates
  • Added Fill() to draw the pending layers into the bitmap
  • Added Resolve() to mark the bitmap for overwriting with the next call to Draw()
  • Added Recycle() to unmark the bitmap for overwriting
  • Fixed Save() to properly choose between rendering the pending layers or copying the bitmap

Recipe Functions (previously referred to as pending layers)

  • Added Remember(text, backgroundstyle, textstyle) to add a pending layer
  • Added Forget(n?) to forget all or the last n pending layers

Main Functions

  • Changed Flush() to process all pending layers into the bitmap and forget pending layers
  • Added Paint() to flush pending layers and to render them on screen
  • Changed Clear() to immediately delete any pending layers
  • Changed timers set by passing time in the styles parameter to Destroy() the window

Time Functions

  • Added Cooldown() to wait out the time set by the time style
  • Added Suspend(t) to wait a specified time in ms
  • Changed Wait(t) to be Cooldown() + Suspend(t)

Animation Functions

  • Added FadeIn(t) and FadeOut(t). Use with Wait(t), Cooldown(), or Suspend(t)
    • Example: TextRender("hi", "t:1000").FadeIn(3000).Cooldown().FadeOut(500)

TextRenderDesktop and TextRenderWallpaper are deprecated by Microsoft

  • Fixed TextRenderDesktop to work on Win 11 24H2
  • Broken! TextRenderWallpaper

Parser

  • Fixed a bug where the width and height would be larger than expected when manually set
  • Fixed a bug where global object properties would return blank

Notes

  • WinExist(tr) now returns False when first initialized
  • WinExist(tr) now returns False when the window is destroyed after the time style timer expires
  • Show() and Hide() are no longer equivalent to WinShow and WinHide respectively
  • Hide() now renders the bitmap with 0 alpha. This is not detectable by WinGetTransparent
  • Show() updates the window with 255 alpha

v1.9.3

22 Nov 21:14

Choose a tag to compare

  • Fixes a long-standing bug where instances of TextRender randomly disappear. This was because when the monitor configuration was reset, such as plugging a laptop into an external monitor, the TextRender instance got moved to the desktop, behind every other window.

v1.9.2

20 Jul 17:47

Choose a tag to compare

The following bug appears as a result of the fixes applied in v1.9.1

  • Fixes a popup that appears when the time parameter is set and the user middle clicks calling Blank() after the object is destroyed.

v1.9.1

20 Jul 17:26

Choose a tag to compare

  • Fixes an infinite loop when the display size changes
  • Fixes an invalid method that reduced the rendering speed by half.

v1.9

18 Jul 13:41

Choose a tag to compare

Lots of new tests have been added! New examples (or old ones cleaned up)!

New

  • Updated to use GDI+ v2 for maximum compatibility with Gdip_All and ImagePut.
  • A new screen parameter has been added to specify the x y offsets relative to a monitor index or hMonitor.
  • TextRender is now DPI aware and will scale correctly on multimonitor systems.
  • Introduced reference counting, so the script exits when all instances of TextRender are destroyed.

Bugfixes

  • The codebase has been refactored to keep track of the memory state. These changes fix most bugs.
    • 0 - No backing memory
    • 1 - Memory initialized, not drawn on
    • 2 - Drawing, not yet rendered to screen.
    • 3 - Rendered to screen. Prepare to clear.
  • No longer throws popups on Windows 7
  • Screen resolution changes, such as plugging in a laptop will now redraw images and keep the existing timers
  • Generating a random color is now faster (was a major source of lag)
  • TextRenderDesktop is much more reliable now. (TextRenderWallpaper remains unfixable)
  • Negative screen coordinates are properly accounted for
  • Dragging a TextRender window with the mouse no longer prevents rendering (asynchronous window procedures)
  • Fix a circular reference preventing deletion of the TextRender object

TextRender is considered to be a complete project and is in long term support mode. Keep posted for more updates!