centering small pictures

Jennifer Wren
04 Apr 2023, 01:26

I would really like to center my small pictures (with "show picture" preferably, but only preferably). Can it be done? Can anyone help me with the script for it?


DavyB
04 Apr 2023, 11:03

Here's a bit of code from one of my games. You can probably work out what you need to change. I can't remember where I found this!

msg ("<img src='" + GetFileURL("movieposter.jpg") + "' style='display: block; margin-left: auto; margin-right: auto; width:300px;' />")

mrangel
04 Apr 2023, 14:10

Or just:

PrintCentered ("{img:somefile.jpg}")

Jennifer Wren
04 Apr 2023, 14:46

Great! Thank you, both.
I tried the second, PrintCentered ("{img:somefile.jpg}"), because it looked easier. And it works.
The first idea looks like a lot of fun to play with. It could be useful in more than one way, but I am too impatient for it, at this point.


DavyB
04 Apr 2023, 21:18

Yes, I should have said that I needed to scale the size of my image, which is the "300px" bit at the end. Perhaps the rest is connected with that as well? I really should make an effort to understand the markup language!