RubberViews: I hadn’t gotten around to using it until now, but want to use it in my upcoming game, to allow it to play inside a 1366x768 window with a consistent look font wise, even if the user has their system on larger fonts (125%, etc). I have the window so it can’t be resized, so that isn’t an issue. This has caused me no end of grief using VB6.
Will RubberViews work for that purpose? The window has a graphic in the Backdrop, and some text labels (using TrueType fonts) and canvas graphics.
I placed the RubberViews item from the RubberViews_Classes onto the window, put the following code in the Open event:
RubberViews1.Init(Self)
RubberViews1.SizAll(Self)
Is that all I need to do to accomplish this? Will this work even in Windows 7, where fonts are known to be handled oddly?
Then everything will be resized automatically, and the scale is taken care as well.
For canvases, backdrop will be resized automatically. But you must make sure everything in Paint is proportional to the size of the canvas. Otherwise, you can replace by RubberCanvas, which will also resize what is in Paint.
For the window backdrop, you want to set StretchWindowBackdrop true, so whatever size the window takes, the graphic will be resized as well.
RubberViews is compatible with Windows XP, Windows Vista, Windows 7, Windows 8.x and Windows 10.
Windows 7 has indeed a strange way of addressing text size only, which throws off RubberViews.
The workaround consists into setting the textsize in the Open event of the controls, to reinstate the design size.
For instance
Me.TextSize = 12
will keep a label textsize the same as what would have happened with setting System font, size zero, in the IDE, and font scaling was at 100%.
I know it is some work to implement, but that is the only way I found to go around Windows 7 text scaling. Afterward, RubberViews will give you results proportional to your design.
Thanks for figuring that one out! I’d like to see design-time text size recording be a part of RubberViews, as it definitely would fix a lot of weird presentation issues with many people, as we’ve read on these threads. That way, I know, no matter what Windows version they have and no matter if their system font size is set to Normal or Large, it will always look the same on all systems. Don’t know if that could be built into the product, but just a request.
That would be great, but unfortunately just like the actual design time size of a window, that is only accessible in the project, not at run time.
All RubberViews knows is what it detects in the window Open with Init. By then, Windows 7 scaling has already modified the font sizes, and under Windows (the system) Windows (the control) that are bigger at design time than the screen will have been resized to fit.
So the only way to fix that is to inform RubberViews of the design size of the window in Init, and to reset the TextSize of controls to design size.