View previous topic :: View next topic |
Author |
Message |
kucingkembar Advanced Cheater
Reputation: 0
Joined: 08 Oct 2020 Posts: 71
|
Posted: Mon Nov 02, 2020 1:05 pm Post subject: is possible add emoticon or text style in Label? |
|
|
i like add emoticon like this ,
and/or make the characters bold / italic / underline or colored text in label(form label),
is that possible?
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25806 Location: The netherlands
|
Posted: Mon Nov 02, 2020 1:23 pm Post subject: |
|
|
use an image/paintbox and render the text in there using canvas draw operations
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
kucingkembar Advanced Cheater
Reputation: 0
Joined: 08 Oct 2020 Posts: 71
|
Posted: Mon Nov 02, 2020 2:10 pm Post subject: |
|
|
please teach me dark byte, any link, or google keyword?
|
|
Back to top |
|
 |
kucingkembar Advanced Cheater
Reputation: 0
Joined: 08 Oct 2020 Posts: 71
|
Posted: Tue Nov 03, 2020 1:08 am Post subject: |
|
|
somebody please, any syntax or clue how to do this please
|
|
Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Tue Nov 03, 2020 2:41 am Post subject: |
|
|
I think this post must be posting on CE Lua scripting section, but what ever.
Here an example. Note, I am not using paintbox which mean I draw the text + image directly on form canvas. Also you need to resize your image pixel adjust to your text size (use photoshop or what ever app to resize the image).
Code: | if fm then fm.destroy() end
fm = createForm()
fm.setSize(500, 200)
fm.Position = 'poScreenCenter'
fm.BorderStyle = 'bsSingle'
fm.Caption = 'Test'
function FormPaint(sender)
Canvas = fm.Canvas
Canvas.Brush.Style = 'bsClear'
Canvas.setPenPosition(20, 100)
Canvas.Font.Name = 'Segoe UI';
Canvas.Font.Color = 1710731
Canvas.Font.Style = '[]'
Canvas.Font.Height = 64
Canvas.TextOut(20,100, 'This ');
X,Y = Canvas.getPenPosition()
Canvas.Font.Color = 13464600
Canvas.Font.Style = '[fsBold]'
Canvas.Font.Height = 64
Canvas.TextOut(X, Y, 'is ');
X,Y = Canvas.getPenPosition()
Canvas.Font.Name = 'Bookman Old Style';
Canvas.Font.Color = 0
Canvas.Font.Style = '[fsItalic]'
Canvas.Font.Height = 64;
Canvas.TextOut(X, Y, 'a ')
X,Y = Canvas.getPenPosition()
Canvas.Font.Name = 'Courier New';
Canvas.Font.Color = 52582
Canvas.Font.Style = '[]'
Canvas.Font.Height = 64
Canvas.TextOut(X, Y, 'test!')
if bm then bm.destroy() end
bm = createPicture()
bm.width = 30
bm.heigt = 30
bm.loadFromFile('D:\\smile.png')
X,Y = Canvas.getPenPosition()
Canvas.draw(X, Y+10, bm.Bitmap)
end
fm.OnPaint = FormPaint |
Description: |
|
Filesize: |
21.7 KB |
Viewed: |
1415 Time(s) |

|
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
 |
kucingkembar Advanced Cheater
Reputation: 0
Joined: 08 Oct 2020 Posts: 71
|
Posted: Tue Nov 03, 2020 3:00 am Post subject: |
|
|
thank you thank you thank you this is what i looking for, thank you
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25806 Location: The netherlands
|
Posted: Tue Nov 03, 2020 3:06 am Post subject: |
|
|
Here's an alternate version using textrect
Code: |
if fm then fm.destroy() end
fm = createForm()
fm.setSize(500, 200)
fm.Position = 'poScreenCenter'
fm.BorderStyle = 'bsSingle'
fm.Caption = 'Test'
function colorinttorgb(colorint)
local red=colorint & 0xff
local green=(colorint >> 8) & 0xff
local blue=(colorint >> 16) & 0xff
return red,green,blue
end
function colortextcode(c)
local r,g,b=colorinttorgb(c)
return string.char(27)..'[38;2;'..r..';'..g..';'..b..'m'
end
function fontselect(s)
return string.char(27)..'['..(11+s)..'m'
end
function FormPaint(sender)
Canvas = fm.Canvas
Canvas.Brush.Style = 'bsClear'
Canvas.setPenPosition(20, 100)
Canvas.Font.Name = 'Segoe UI';
Canvas.Font.Color = 1710731
Canvas.Font.Style = '[]'
Canvas.Font.Height = 64
z=Canvas.TextRect({Top=0,Left=0,Right=fm.Width,Bottom=fm.Height}, 20,100,'This '..colortextcode(13464600)..'[b]is[/b] '..colortextcode(0)..'[i]a[/i] '..colortextcode(52582)..fontselect(2)..'test');
if bm then bm.destroy() end
bm = createPicture()
bm.width = 30
bm.heigt = 30
bm.loadFromFile('D:\\smile.png')
Canvas.draw(z.Right, z.Top+10, bm.Bitmap)
end
fm.OnPaint = FormPaint
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
kucingkembar Advanced Cheater
Reputation: 0
Joined: 08 Oct 2020 Posts: 71
|
Posted: Tue Nov 03, 2020 4:57 am Post subject: |
|
|
thank you dark byte, I studying your code too
|
|
Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Tue Nov 03, 2020 5:27 am Post subject: |
|
|
Great DB, this function is interesting.
Code: | function colortextcode(c)
local r,g,b=colorinttorgb(c)
return string.char(27)..'[38;2;'..r..';'..g..';'..b..'m'
end |
So, the function return ANSI color code, I was looking for this function and finally I found it from you. Thanks so much
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
 |
|