Atavis
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 1463 |
|
|
| 19 Apr 2017 12:25 PM |
I want to have an image label retain it's dimensions, but also resize* according to screen size. How do you achieve this??
*my image is 1920x1080 but this is too large for conventional screens in terms of the scale I'm after. But I'd like it to get bigger for bigger screens, as 480x270 isn't expressing it's full "beauty".
Is this possible?
#code --This validates my comment. |
|
|
| Report Abuse |
|
|
Atavis
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 1463 |
|
|
| 19 Apr 2017 12:32 PM |
How do I get the size of the user's screen in pixels?
#code --This validates my comment. |
|
|
| Report Abuse |
|
|
Salinas23
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 37141 |
|
|
| 19 Apr 2017 01:27 PM |
ScreenGui.AbsoluteSize
I have a spider on my back. |
|
|
| Report Abuse |
|
|
Atavis
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 1463 |
|
|
| 19 Apr 2017 02:05 PM |
ty :P
local screen = Instance.new("ScreenGui") screen.Parent = plrGui local absSize = screen.AbsoluteSize local frame = Instance.new("Frame") frame.Parent = screen frame.Size = UDim2.new(1, 0, 1, 0) frame.BorderSizePixel = 0 local imageLabel = Instance.new("ImageLabel") --imageLabel.Size = UDim2.new(0, 480, 0, 270) local sizeX = 0.4*(absSize.X) local sizeY = sizeX*0.5625 imageLabel.Size = UDim2.new(0, sizeX, 0, sizeY) imageLabel.Position = UDim2.new(0, (absSize.X - sizeX)/2, 0, (absSize.Y - sizeY)/2) imageLabel.BackgroundTransparency = 1 imageLabel.BorderSizePixel = 0
imageLabel.Image = "rbxassetid://" .. imageID imageLabel.Parent = frame
#code --This validates my comment. |
|
|
| Report Abuse |
|
|
JoshRBX
|
  |
| Joined: 19 May 2012 |
| Total Posts: 8778 |
|
|
| 19 Apr 2017 02:14 PM |
Or just make the GUI yourself in studio first? That'd make it much quicker.
|
|
|
| Report Abuse |
|
|
Atavis
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 1463 |
|
|
| 19 Apr 2017 02:20 PM |
pls read the post first k ty thanks bye
#code --This validates my comment. |
|
|
| Report Abuse |
|
|
Atavis
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 1463 |
|
|
| 19 Apr 2017 02:21 PM |
o wait soz I get you.
This is for an intro gui. Would waiting for the screengui to come into existence not take just about as much time? This is a pretty simple declaration anyway.
#code --This validates my comment. |
|
|
| Report Abuse |
|
|