generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: ImageLabel

Previous Thread :: Next Thread 
Atavis is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image