TextRender v1.7 - Draw text on screen

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: TextRender v1.7 - Draw text on screen

Post by gwarble » 28 Sep 2022, 21:38

I guess I would expect if the functionality changes or a bug is fixed then the release number would change therefore the date. I was unfortunate to download between 6/2022 at version 1.8 and the bug fix in 8/2022, never thought to redownload. I almost didn't even when you recommended it because the version and date were the same, but I did actually in case i had tried modifying the code in the past and broke something i wanted to start clean, ha

Anyway, totally up to you how you do your rev control, just food for thought. Related, I would recommend updating the thread title to match as well.


I think the trick for positioning with TextRenderWallpaper will be to base everything off the 0,0 being the actual left most and top most of any screen, independently. That actually kinda makes sense if its the "hidden window behind the desktop icons" is a window but i need to test still to confirm this.


As for your documentation, I like the two seperate pages "Methods" and "Styles" or whatever they are, I will continue to reference them until i have everything memorized. Your structure for how the library is created and syntax in use is inspiration to finally create a Notify() class version myself. Other than that I will take a look and see if there is anything noteworthy.
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .

iseahound
Posts: 1434
Joined: 13 Aug 2016, 21:04
Contact:

Re: TextRender v1.7 - Draw text on screen

Post by iseahound » 29 Sep 2022, 19:35

Okay, fixed wallpaper rendering offsets. Was not as simple as it seemed, since I did some work to make it any parent window. https://github.com/iseahound/TextRender

Question: Have you noticed any bugs, like the window disappearing after a period of time with TextRenderWallpaper? (TextRenderDesktop is broken, and will remain that way)

Edit: TextRenderDesktop should be much more reliable now.
Last edited by iseahound on 29 Sep 2022, 21:34, edited 1 time in total.

User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: TextRender v1.7 - Draw text on screen

Post by gwarble » 29 Sep 2022, 20:31

wow thanks for looking into it so quickly

i would say, and without any significant testing beyond plugging the new version into my project, that its partially fixed.

New and old versions work fine when 0,0 is the top left most point
Old version failed when second monitor was to the right but higher than 0,0, new version is fixed
But, both versions fail when left monitor is in the negative x range.

The improvement is that when the left monitor is in the negative x range, the right monitor is positioning where I expect, but the left monitor is out of range. The old version on the other hand had the right monitor out of range but the left monitor positioned low (affected by the right monitor)

I will try to test further and narrow down as best I can, also could be missing something and the problem could be on my end.
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .


User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: TextRender v1.7 - Draw text on screen

Post by gwarble » 30 Sep 2022, 09:23

perfect, that seems to have fixed it in all screen configurations

thank you!
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .

iseahound
Posts: 1434
Joined: 13 Aug 2016, 21:04
Contact:

Re: TextRender v1.7 - Draw text on screen

Post by iseahound » 04 Oct 2022, 19:00

okay I had no idea TextRender was capable of like basic animation. wow

Code: Select all

; just click on the square to go to the next slide

#Requires AutoHotkey v1.1.33+
tr := TextRender("Click me", "w:500px h:500px m:0 c:random", "v:center")
tr.None() ; IMPORTANT: Removes all default events. 
tr.OnEvent("LeftMouseDown", Func("fn"))

fn(this) { ; "this" must be the first parameter.
    static n := 1
    static frames := ["oops", "I", "did", "it", "again"]
    this.draw(frames[n++], "w:500px h:500px m:0 c:random", "v:center")
    this.fade()
}
also I deleted the double click events.

immorrr
Posts: 7
Joined: 07 Sep 2014, 21:23

Re: TextRender v1.7 - Draw text on screen

Post by immorrr » 14 Nov 2022, 17:12

First of all thank you for this amazing library!

I got two question, first is it possible to render text on another fullscreen (i mean true fs not window max or something) app?
And second is there a way to ''attach the text to render to another app''? What i mean by that is is there an option to position the text e.g. top-center on another window?

Thanks in advance and once again awesome work on this library!

iseahound
Posts: 1434
Joined: 13 Aug 2016, 21:04
Contact:

Re: TextRender v1.7 - Draw text on screen

Post by iseahound » 15 Nov 2022, 22:38

Kind of, but the coordinates do not work too well since they are based on the screen, not on the window.

Code: Select all

WS_Child := 0x40000000
notepad := WinExist("Untitled - Notepad")
tr := new TextRender("MyWindowTitle", WS_CHILD,, notepad)
tr.Render("hi", "t: 8000 x: 100 y: 100")
Anyways I think you're asking for a video game overlay, which isn't supported since they use DirectX.

potscrubber
Posts: 36
Joined: 09 Sep 2017, 01:51
Location: Aotearoa
Contact:

Re: TextRender v1.7 - Draw text on screen

Post by potscrubber » 13 Mar 2023, 17:55

@iseahound this is a really nice and modern execution of gdip for AHK - thank-you!

Just wondering if you had in any interest in incorporating gdiplus\GdipCreateLineBrushFromRect ? Using it with two similar colors for the background and rounded corners can give a really nice very slightly 3D background for the OSD or whatever the usage.

all the best!

iseahound
Posts: 1434
Joined: 13 Aug 2016, 21:04
Contact:

Re: TextRender v1.7 - Draw text on screen

Post by iseahound » 15 Jul 2023, 18:13

@gwarble There is a screen parameter added in the latest version on GitHub. A new release should be out soon after some more testing.

Code: Select all

#include *i TextRender.ahk             ; AutoHotkey v2
#include *i TextRender (for v1).ahk ; AutoHotkey v1

; String notation
tr := TextRender("Screen 2", "screen: 2 x: 100 y: 100")
tr := TextRender("Screen 2", "s: 2 x: 100 y: 100")

; Object Notation
tr := TextRender("Screen 2", {screen: 2, x: 100, y: 100})
tr := TextRender("Screen 2", {s: 2, x: 100, y: 100})

; Legacy Syntax
tr := TextRender("Screen 2", "screen2 x100 y100")

User avatar
kunkel321
Posts: 976
Joined: 30 Nov 2015, 21:19

Re: TextRender v1.7 - Draw text on screen

Post by kunkel321 » 16 Jul 2023, 10:48

Hey Iseahound! I'm glad to see that you are still keeping this project alive. This project must supersede your previous one, yes? I've been using Subtitle.ahk periodically over the years, to put text on my desktop. Should I start using TextRender, instead?

Code: Select all

; Script:    Subtitle.ahk
; Author:    iseahound
; Version:   2018-04-17 (April 2018)
; Recent:    2018-05-15
ste(phen|ve) kunkel

iseahound
Posts: 1434
Joined: 13 Aug 2016, 21:04
Contact:

Re: TextRender v1.7 - Draw text on screen

Post by iseahound » 16 Jul 2023, 14:42

Yes! It's been kept alive as it seems to be the only decent way to get text on the screen. It's also highly optimized, I believe one of the tests show rendering at over 1000 fps.

There is also a version that runs on AutoHotkey v2.

Thanks for showing interest in the project, it needs more love

Post Reply

Return to “Scripts and Functions (v1)”