08-31-2023, 11:52 AM
(This post was last modified: 08-31-2023, 12:14 PM by grymmjack.
Edit Reason: added dom container resize to 50% width
)
Hi guys!
I'm glad this is happening with regard to resolution.
How about this - if you need to you can design at 50% width and 50% height - with the caveat that you use a `CONST` for the width and height and it's easy to change in one spot to get it to display at 1400 x 256?
We can use CSS to keep the canvas element scalable possibly - I will make another qbjsbanner that is 700 x 128 called qbjsbanner50.
I did a test in qbjs.org with your code (which BTW @bplus it's awesome) by resizing the canvas element it renders to 50% width and it seems like it works without any issue.
I think we could even make it responsive like the current image is to a fault.
Use `[ qbjsbanner50 ]` code `[ /qbjsbanner50 ]`(remove spaces).
To make this resize work correctly add this to the top of your QBJS code before anything else:
The `Import` and `Dom` stuff is documented on this page:
https://github.com/boxgaming/qbjs/wiki/S...ywords#dom
This is how you can access the stuff outside of the QB64 domain and in the web side.
I'm glad this is happening with regard to resolution.
How about this - if you need to you can design at 50% width and 50% height - with the caveat that you use a `CONST` for the width and height and it's easy to change in one spot to get it to display at 1400 x 256?
We can use CSS to keep the canvas element scalable possibly - I will make another qbjsbanner that is 700 x 128 called qbjsbanner50.
I did a test in qbjs.org with your code (which BTW @bplus it's awesome) by resizing the canvas element it renders to 50% width and it seems like it works without any issue.
I think we could even make it responsive like the current image is to a fault.
Use `[ qbjsbanner50 ]` code `[ /qbjsbanner50 ]`(remove spaces).
To make this resize work correctly add this to the top of your QBJS code before anything else:
Code: (Select All)
Import Dom From "lib/web/dom.bas"
Dom.GetImage(0).style.width = "700px"
Dom.GetImage(0).style.height = "128px"
Dom.Container().style.width = "700px"
Dom.Container().style.height = "128px"
Dom.Container().style.overflow = "hidden"
The `Import` and `Dom` stuff is documented on this page:
https://github.com/boxgaming/qbjs/wiki/S...ywords#dom
This is how you can access the stuff outside of the QB64 domain and in the web side.