Add_Icon(arg as icon)
usr.overlays+= arg
Problem Description: I want to know how to limit the size of custom overlays to 32x32 to prevent people from adding things like pictures or even icons what take up most of the screen
Code:
Add_Icon(arg as icon) Problem Description: I want to know how to limit the size of custom overlays to 32x32 to prevent people from adding things like pictures or even icons what take up most of the screen |
Sep 15 2012, 5:44 am
|
|
I just use icon.Scale(iconsize) when giving players the ability to make their own icons.
|
In response to NNAAAAHH
|
|
I'm doing my best with trying to learn how to code on my own, but how would I specifically put that in?
|
You can use the icon/Width() and icon/Height() processes to get the size of the icon. You might have to create a new /icon object from it first.
|
I was going to recomend those but I was unsure if they were trying to ensure it didn't go over a certain size or if they were just trying to make sure everything fit.
But in example: var/icon/i=new(icon) |
In response to NNAAAAHH
|
|
NNAAAAHH wrote:
I was going to recomend those but I was unsure if they were trying to ensure it didn't go over a certain size or if they were just trying to make sure everything fit. var/icon/i=new(icon) Thanks! This is what I needed, I didn't want custom overlays going over a certain size. |
In response to Asterr
|
|
if(i.Width>sizex||i.Height>sizey) can be used to check if the width or height(in pixels) is greater than what you wish, then use .Scale() to set it to the desired size. Like DarkCampainger said.
|