Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help,
read this .
cristoferfb
Prole
Posts: 16 Joined: Wed May 15, 2019 12:41 am
Location: Valparaiso, Chile.
Post
by cristoferfb » Mon May 18, 2020 11:00 pm
Hi ! I currently doing some tests with UI in LOVE2D, actually I am trying to implement a
floating action button (1) acordly to the documentation the "mini" version of this component have 20 dp of radius so I do this in my LOVE2D code:
Code: Select all
love.graphics.circle("fill", self:getX(), self:getY(), love.window.toPixels(20)) -- convert 20 dp to pixels
but the result in my screen is bigger than expected:
Screenshot_LÖVE_for_Android_20200518-185029.png (24.35 KiB) Viewed 2633 times
What I am doing wrong?
[1]
https://material.io/components/buttons- ... ion-button
slime
Solid Snayke
Posts: 3161 Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:
Post
by slime » Mon May 18, 2020 11:03 pm
love already uses DP units by default, so you should just be able to remove the toPixels call.
cristoferfb
Prole
Posts: 16 Joined: Wed May 15, 2019 12:41 am
Location: Valparaiso, Chile.
Post
by cristoferfb » Mon May 18, 2020 11:18 pm
slime wrote: ↑ Mon May 18, 2020 11:03 pm
love already uses DP units by default, so you should just be able to remove the toPixels call.
DAMN thanks
Users browsing this forum: Ahrefs [Bot] , Bing [Bot] , Google [Bot] and 7 guests