Page 1 of 2

DisplayTextObjectFX

Posted: Tue Mar 31, 2026 3:57 pm
by Juan Carlos
This instruction on Linux doesn't work DisplayTextObjectFX, the text isn't showed, any idea?

Re: DisplayTextObjectFX

Posted: Tue Apr 14, 2026 5:22 pm
by airsoftsoftwair
MCVE please :)

Re: DisplayTextObjectFX

Posted: Thu Apr 16, 2026 11:49 am
by Juan Carlos
The example is very easy with the program star in a little background picture and showing the DisplayTextObjectFX, this problem only happen on Linux, on Windows, MorphOS and AmigaOS 3.9, not.
Function p_Intro()
PlaySample(1, 1)
EnableLayers()
DisplayBrush(1, 0, 0) ;Cover.
DisplayTextObjectFX(1, 20, 80, {Type=#RECTCENTER, Speed=10})
DisplayTextObjectFX(2, 40, 120, {Type=#RECTCENTER, Speed=10})
DisplayTextObjectFX(3, 200, 150, {Type=#RECTCENTER, Speed=10})
Wait(55)
CloseDisplay(1)

CreateDisplay(2, {Title="Baphomet Screen Saver", Desktop=True, Active=True, NoModeSwitch=True,
Color=#BLACK, DisableBlanker=True})
;SetScreenTitle(#Head) ;MorphOS.

AnchoIntro=GetAttribute(#DISPLAY, 2, #ATTRWIDTH)
AltoIntro=GetAttribute(#DISPLAY, 2, #ATTRHEIGHT)

;Para resoluciones inferiores a 640 el salvapantallas no funciona.
If AnchoIntro<=640
CreateDisplay(3, {Title="Baphomet Screen Saver", Width=320, Height=180, Color=#BLACK, Borderless=True,
NoClose=False, KeepProportions=True, Sizeable=False, NoModeSwitch=True, Active=True})

OpenDisplay(3)
DisplayBrush(2, 0, 0) ;Aviso.
DisplayTextObjectFX(1, #CENTER, 0, {Type=#RECTCENTER, Speed=10})
DisplayTextObjectFX(2, #CENTER, 50, {Type=#RECTCENTER, Speed=10})
DisplayTextObjectFX(4, #CENTER, 110, {Type=#RECTCENTER, Speed=10})
Wait(120)
End()

Else
OpenDisplay(2)

FreeBrush(1) ;Cover.
FreeBrush(2) ;Aviso.
FreeTextObject(1) ;Liberamos el Texto Objeto 1.
FreeTextObject(2) ;Liberamos el Texto Objeto 2.
FreeTextObject(3) ;Liberamos el Texto Objeto 3.
FreeTextObject(4) ;Liberamos el Texto Objeto 4.

FreeDisplay(1) ;Cierra y elimina la portada.

HidePointer()

p_Variables()

p_Inicio()
EndIf
EndFunction

Re: DisplayTextObjectFX

Posted: Thu Apr 16, 2026 2:32 pm
by Flinx
Hi Juan Carlos,
You're making it difficult to help you because your example doesn't work. It uses a lot of things that aren't available, so it's hard to tell where the problem lies.
Here are the relevant lines of your code, but of course they work on Linux too. (I expected that, since I've used the function before and never had a problem.)
If that doesn't help, then build a working example that doesn't work on Linux.

Code: Select all

Function p_Intro()
	DisplayTextObjectFX(1, 20, 80, {Type=#RECTCENTER, Speed=2})
	DisplayTextObjectFX(2, 40, 120, {Type=#RECTCENTER, Speed=10})
	Wait(55)
	CloseDisplay(1)
EndFunction 

SetFontColor(#YELLOW)
CreateTextObject(1, "TextObject number one")
CreateTextObject(2, "TextObject number two")

p_Intro()

Re: DisplayTextObjectFX

Posted: Thu Apr 16, 2026 9:47 pm
by Juan Carlos
The code uses the BGPic 1, as little Windows to launch the main program, but this trick works in other systems less on Linux.
Also there are the textobjefts, but the basic visual effect is open a little Windows using the BGPic closes this Windows and open the main program window.

Re: DisplayTextObjectFX

Posted: Thu Apr 16, 2026 11:04 pm
by Flinx
Ok. But don't just tell us.
Show us.

And, did you try my example?

Re: DisplayTextObjectFX

Posted: Fri Apr 17, 2026 3:34 pm
by Juan Carlos
Yes, and on Linux Mint it works.

Re: DisplayTextObjectFX

Posted: Sun Apr 19, 2026 9:42 pm
by airsoftsoftwair
Juan Carlos wrote: Fri Apr 17, 2026 3:34 pm Yes, and on Linux Mint it works.
So you still need to provide some proof that the bug isn't in your code, i.e. we need an MCVE :)

Re: DisplayTextObjectFX

Posted: Mon Apr 20, 2026 11:01 am
by Juan Carlos
It is a little complicated make a little example for you, but I'll try it.

Re: DisplayTextObjectFX

Posted: Mon Apr 20, 2026 12:37 pm
by Flinx
Whenever I’ve looked for bugs like this, it’s almost always turned out to be a minor issue in my own code.

While you are trying to build the “little example”, you might want to watch out for problems like these:
- A layer is covering the text objects that were created
- The text objects are transparent (SetFontColor can can be set to an ARGB value)
- The generated text objects have the same color as the background on which they are displayed and are therefore not visible
- The font size is too small
- The position could also be a cause, but probably not in your example, since there are fixed values there.

I don’t have any idea right now why something like this would happen only on Linux, but you have to start looking somewhere.