Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


is possible add emoticon or text style in Label?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
kucingkembar
Advanced Cheater
Reputation: 0

Joined: 08 Oct 2020
Posts: 71

PostPosted: Mon Nov 02, 2020 1:05 pm    Post subject: is possible add emoticon or text style in Label? Reply with quote

i like add emoticon like this Very Happy,
and/or make the characters bold / italic / underline or colored text in label(form label),
is that possible?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25806
Location: The netherlands

PostPosted: Mon Nov 02, 2020 1:23 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
kucingkembar
Advanced Cheater
Reputation: 0

Joined: 08 Oct 2020
Posts: 71

PostPosted: Mon Nov 02, 2020 2:10 pm    Post subject: Reply with quote

please teach me dark byte, any link, or google keyword?
Back to top
View user's profile Send private message
kucingkembar
Advanced Cheater
Reputation: 0

Joined: 08 Oct 2020
Posts: 71

PostPosted: Tue Nov 03, 2020 1:08 am    Post subject: Reply with quote

somebody please, any syntax or clue how to do this please
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Tue Nov 03, 2020 2:41 am    Post subject: Reply with quote

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



Capture.JPG
 Description:
Result
 Filesize:  21.7 KB
 Viewed:  1414 Time(s)

Capture.JPG



_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
kucingkembar
Advanced Cheater
Reputation: 0

Joined: 08 Oct 2020
Posts: 71

PostPosted: Tue Nov 03, 2020 3:00 am    Post subject: Reply with quote

thank you thank you thank you this is what i looking for, thank you
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25806
Location: The netherlands

PostPosted: Tue Nov 03, 2020 3:06 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
kucingkembar
Advanced Cheater
Reputation: 0

Joined: 08 Oct 2020
Posts: 71

PostPosted: Tue Nov 03, 2020 4:57 am    Post subject: Reply with quote

thank you dark byte, I studying your code too
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Tue Nov 03, 2020 5:27 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites