- Home /
Canvas Scaler doesn't affect fontsize when set to ConstantPixelSize
So, I have an issue with the Canvas Scaler that I'm not sure how to address.
I want to build a grid of images and I want a 1 pixel border around each image. I also want Text labels.
If I set the Canvas Scaler to Scale with Screen Size, then I sometimes lose my 1 pxl border (it is scaled out on some devices). But if I set it to Constant Pixel Size, my font sizes are not properly scaled. The region of the font is nice and dynamic, but the fontSize itself does not adjust with the Canvas Scaler.
My first thought was to derive my own Text component that scales the font size. That seemed to work for a second, but then I realized that fontSize is not a float, which makes it very imprecise.
What's also sad is that it looks great while I'm resizing the window by dragging the corner around, but then it recalculates the text with the font size.
Any help would be appreciated, not sure what to do.