Pflichtfeld Active Member Licensed User Mar 31, 2020 #1 Try for a while to draw text to a canvas. Issue is the font object. Erel writes in https://www.b4x.com/guides/B4xXUI/?page=20 xLabelFont = xui.CreateDefaultFont(16) But I have no XUI-class, although the XUI-Lib (and XUI Views)is loaded I declared it: Dim fnt As B4XFont fnt=xui... does not react, means xui is not offered. fnt.ToNativeFont makes no text-output at all. Where is my fault?
Try for a while to draw text to a canvas. Issue is the font object. Erel writes in https://www.b4x.com/guides/B4xXUI/?page=20 xLabelFont = xui.CreateDefaultFont(16) But I have no XUI-class, although the XUI-Lib (and XUI Views)is loaded I declared it: Dim fnt As B4XFont fnt=xui... does not react, means xui is not offered. fnt.ToNativeFont makes no text-output at all. Where is my fault?
Erel B4X founder Staff member Licensed User Longtime User Mar 31, 2020 #2 Pflichtfeld said: Where is my fault? Click to expand... 1. Not using code tags when posting. 2. Add a global xui object: Code: Private xui As XUI Upvote 0
Pflichtfeld said: Where is my fault? Click to expand... 1. Not using code tags when posting. 2. Add a global xui object: Code: Private xui As XUI
Pflichtfeld Active Member Licensed User Mar 31, 2020 #3 Thanks Erel, I I tried it with B4X: Public xui As XUI or with B4X: Private xui As XUI in Starter, Process_Globals, as you recommend. But it does not work. Noticed now, that it works, when I add it in Main, Process_Globals, what I do not understand. Upvote 0
Thanks Erel, I I tried it with B4X: Public xui As XUI or with B4X: Private xui As XUI in Starter, Process_Globals, as you recommend. But it does not work. Noticed now, that it works, when I add it in Main, Process_Globals, what I do not understand.
Erel B4X founder Staff member Licensed User Longtime User Mar 31, 2020 #4 Best to add it to each of the modules. Upvote 0
Pflichtfeld Active Member Licensed User Mar 31, 2020 #5 Why does it not work, when I add it as Public in starter, Process_Globals ? It should thus be available everywhere, isn't it? (but ist not) Upvote 0
Why does it not work, when I add it as Public in starter, Process_Globals ? It should thus be available everywhere, isn't it? (but ist not)
Erel B4X founder Staff member Licensed User Longtime User Apr 1, 2020 #6 Pflichtfeld said: It should thus be available everywhere, isn't it? Click to expand... Yes. But you need to call it correctly: Code: lbl.Font = Starter.XUI.CreateFont(...) Upvote 0
Pflichtfeld said: It should thus be available everywhere, isn't it? Click to expand... Yes. But you need to call it correctly: Code: lbl.Font = Starter.XUI.CreateFont(...)
Pflichtfeld Active Member Licensed User Apr 1, 2020 #7 Erel said: Code: lbl.Font = Starter.XUI.CreateFont(...) Click to expand... Thanks again Erel! As a newbie in b4x I've been reading and watching so much now and I thought, I had read (or heard) that global variables should be declared in Starter Process_Globals and that these (only these) are available everywhere without adding the module-name ('starter') But it seems, I remember that wrong! Maybe I am confused, because types are dealt in another way: Types, declared in Starter Process_Globals are visible without the starter-module-name: B4X: Sub Process_Globals Type Mypkt(x As Float,y As Float,isError As Boolean) Public xui As XUI Public isItVisibleEverywhere As String End Sub is in a sub in Main available as B4X: Sub drawGrindEdge(pan As B4XView, alpha As Float, onebevel As Boolean) Dim canv As B4XCanvas Dim pkt (5) As Mypkt Dim pHelp As Mypkt And B4X: Sub drawGrindEdge(pan As B4XView, alpha As Float, onebevel As Boolean) Dim canv As B4XCanvas Dim pkt (5) As Mypkt Dim pHelp As Starter.Mypkt 'is wrong is wrong Got it now. Thank you. Last edited: Apr 1, 2020 Upvote 0
Erel said: Code: lbl.Font = Starter.XUI.CreateFont(...) Click to expand... Thanks again Erel! As a newbie in b4x I've been reading and watching so much now and I thought, I had read (or heard) that global variables should be declared in Starter Process_Globals and that these (only these) are available everywhere without adding the module-name ('starter') But it seems, I remember that wrong! Maybe I am confused, because types are dealt in another way: Types, declared in Starter Process_Globals are visible without the starter-module-name: B4X: Sub Process_Globals Type Mypkt(x As Float,y As Float,isError As Boolean) Public xui As XUI Public isItVisibleEverywhere As String End Sub is in a sub in Main available as B4X: Sub drawGrindEdge(pan As B4XView, alpha As Float, onebevel As Boolean) Dim canv As B4XCanvas Dim pkt (5) As Mypkt Dim pHelp As Mypkt And B4X: Sub drawGrindEdge(pan As B4XView, alpha As Float, onebevel As Boolean) Dim canv As B4XCanvas Dim pkt (5) As Mypkt Dim pHelp As Starter.Mypkt 'is wrong is wrong Got it now. Thank you.