Releases: iseahound/TextRender
v2.1.3
v2.1.2
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
- 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
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()andDestroy()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
timeis 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
FadeInandFadeOut - OnFadeIn
- OnFadeOut
Cooldowns and Animations have been modified to be more consistent.
- FadeOut() can now be called before FadeIn()
- Setting the
timein 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
Updated examples and fixed incorrect proof of Reallocate()
For breaking changes see: https://github.com/iseahound/TextRender/releases/tag/v2.0
v2.0
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
NonetoNoEvents - Rename
DefaulttoDefaultEvents - Rename
FlushtoResolve - Rename
FreeMemorytoFree - Rename
UpdateLayeredWindowtoUpdateLayered - Rename
ToggleVisibletoShowHide - 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
timestyle - 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
npending 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
timein the styles parameter to Destroy() the window
Time Functions
- Added Cooldown() to wait out the time set by the
timestyle - 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)
- Example:
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 initializedWinExist(tr)now returns False when the window is destroyed after thetimestyle timer expires- Show() and Hide() are no longer equivalent to
WinShowandWinHiderespectively - Hide() now renders the bitmap with 0 alpha. This is not detectable by
WinGetTransparent - Show() updates the window with 255 alpha
v1.9.3
- 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
v1.9.1
v1.9
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!