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 


How to set shape as rounded rectangle

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 202

PostPosted: Wed Nov 27, 2019 4:12 am    Post subject: How to set shape as rounded rectangle Reply with quote

I can only set it to inverted triangle, but this is not the real fillet.
Addpolygon to generate the fillet
Code:
if f then f.destroy() end
vv=5
vx=200
vy=200
f=createForm()
f.BorderStyle=bsNone
f.color=0xff
r=createRegion()
r.addRectangle(vv,vv,vx-vv,vy-vv)
r.addPolygon({{0,vv},{0,vx-vv},{vx-vv,0},{vv,0}})--Top left corner
r.addPolygon({{vv,0},{vx-vv,0},{vx,vv},{vx,vx-vv}})--Upper right corner
r.addPolygon({{0,vv},{0,vy-vv},{vv,vy},{vx-vv,vy}})--Lower left quarter
r.addPolygon({{vv,vy},{vx-vv,vy},{vy,vx-vv},{vx,vv}})--Lower right corner
f.setShape(r)
f.OnMouseDown=function() f.dragNow() end



Inverted triangle.png
 Description:
 Filesize:  33.4 KB
 Viewed:  4483 Time(s)

Inverted triangle.png


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Wed Nov 27, 2019 5:14 am    Post subject: Reply with quote

I am assuming you're on ce 7.0 which added roundRect to the canvas methods

Code:

if f then f.destroy() end
f=createForm()
f.BorderStyle=bsNone
f.Width=200
f.Height=200
f.Color=0xff

bm=createBitmap()
bm.Width=f.Width
bm.Height=f.Height
bm.Canvas.Pen.Color=0xff0000  --back/0 is invisible
bm.Canvas.Pen.Width=5
bm.Canvas.Brush.Color=0xff0000
bm.Canvas.roundRect(0,0,200,200,100,100)

f.setShape(bm)

f.OnMouseDown=function() f.dragNow() end

_________________
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
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 202

PostPosted: Thu Nov 28, 2019 12:15 am    Post subject: Reply with quote

Dark Byte wrote:
I am assuming you're on ce 7.0 which added roundRect to the canvas methods
Unfortunately, I used the cheating engine 6.8.3
Code:
fillRect()
Is this all right?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Nov 28, 2019 12:53 am    Post subject: Reply with quote

fillRect is a square so not that usefull
ellipse might be better

_________________
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
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 202

PostPosted: Thu Nov 28, 2019 1:01 am    Post subject: Reply with quote

Dark Byte wrote:
fillRect is a square so not that usefull
ellipse might be better
Code:
ellipse()
You mean this? But can he draw four rounded corners
What if you want to add borders to a drawing
Code:
Canvas.Brush.Style=1



Wire frame.png
 Description:
 Filesize:  35.64 KB
 Viewed:  4436 Time(s)

Wire frame.png


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Nov 28, 2019 3:14 am    Post subject: Reply with quote

You can also just place an image on the form in the background and then use setLayeredAttributes to mark a specific color as see through
_________________
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
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 202

PostPosted: Thu Nov 28, 2019 3:17 am    Post subject: Reply with quote

Dark Byte wrote:
You can also just place an image on the form in the background and then use setLayeredAttributes to mark a specific color as see through
I use setlayeredattributes now, but it's only effective if the computer turns on Aero
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 Lua Scripting 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