Find quick help here to get you started with Hollywood
papiosaur
Posts: 217 Joined: Fri Mar 31, 2023 1:34 pm
Post
by papiosaur » Sun Jul 23, 2023 10:51 am
hello,
i would like to write a text on a picture but don't work, this is my code:
Code: Select all
Enablelayers()
LoadBrush(2, pict$)
ScaleBrush(2, 320, 256)
moai.Set("image", "brush", 2)
SetFontColor(#RED)
OpenFont(1, "Fonts:_ttf/Arimo-Bold.ttf", 72, {Engine = #FONTENGINE_INBUILT})
UseFont(1)
CreateTextObject(1, "Hello World!")
DisplayTextObject(1, #CENTER, #CENTER)
Thanks for your help
papiosaur
Posts: 217 Joined: Fri Mar 31, 2023 1:34 pm
Post
by papiosaur » Sun Jul 23, 2023 11:30 am
The picture is showed but not the text
plouf
Posts: 666 Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece
Post
by plouf » Sun Jul 23, 2023 1:11 pm
What you are trying to is a bit confusing
I see
EnableLayers() and
DisplayTextObject() which are commands supposed to work in diplays fullscreen or hollywooddisplay bit also you set image with moai.set which is rapagui
So you either create a hollywooddisplayinside GUI and brush and then text in there
Or draw on image and then display modified image
Christos
plouf
Posts: 666 Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece
Post
by plouf » Mon Jul 24, 2023 5:27 am
here a full working example usign Hollywooddisplay inside RapaGUI
Code: Select all
xml$ = [[
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
<window id="win" title="Tasks" >
<hgroup>
<vgroup>
<rectangle />
<button id="ok">OK</button>
<hollywood display="2" width="300" height="300"/>
<button id="no">NO</button>
</vgroup>
<vgroup>
<rectangle />
<button id="2">2</button>
<rectangle />
<button id="3">3</button>
</vgroup>
</hgroup>
</window>
</application>
]]
@REQUIRE "RapaGUI"
CreateDisplay(2,{color=#RED,x=300,y=300})
CreateBrush(1,260,260,#GREEN)
moai.CreateApp(xml$)
SelectDisplay(2)
DisplayBrush(1,20,20)
SetFontColor(#YELLOW)
CreateTextObject(1, "Hello World!")
DisplayTextObject(1, #CENTER, #CENTER)
Repeat
WaitEvent
Forever
Christos
papiosaur
Posts: 217 Joined: Fri Mar 31, 2023 1:34 pm
Post
by papiosaur » Mon Jul 24, 2023 2:58 pm
Thanks a lot plouf for the example!
I will try that soon
papiosaur
Posts: 217 Joined: Fri Mar 31, 2023 1:34 pm
Post
by papiosaur » Tue Jul 25, 2023 10:44 pm
@plouf : work perfectly, thanks a lot !