TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
[Solved]A game in the center of the browser?
Pages:
1
[Solved]A game in the center of the browser?
1968
Posts: 103
September 22, 2019, 09:46:06 am
Hello!!!
Is it possible to edit index.html
to start the game in the center of the page?
« Last Edit: September 24, 2019, 07:28:52 am by 1968 »
merrak
Posts: 2732
September 22, 2019, 02:02:33 pm
You could use any HTML editor (or just a simple text editor) to do this... but as far as I'm aware, there's no option to configure the HTML output page in Stencyl.
`/\=======/\"-
Website! -
http://www.anorthogonaluniverse.com
Facebook -
http://www.facebook.com/rlwatson
Twitter -
https://twitter.com/merrak
1968
Posts: 103
September 22, 2019, 09:15:49 pm
Hi Merrak,
I meant "when starting the HTML5 game", the game opened in the center of the browser
NOTA
Posts: 327
September 23, 2019, 12:39:04 pm
Unfortunately, different browsers work differently.
I have been unable to come up with a code for all browsers. This is what I have been doing.
Change position and size of game to desired dimentions
<div id="Layer1" style="position:absolute; left:121px; top:38px; width:754px; height:331px; z-index:1">PASTE UR INDEX HERE</div>
JeffreyDriver
Posts: 2262
September 23, 2019, 01:45:15 pm
Add this to your div style "margin: auto; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);"
Current Projects:
The Grand Grimoire Chronicles Episode 3
Twitter@JeffreyDriver
apps.jeffreydriver.co.uk
NOTA
Posts: 327
September 23, 2019, 03:59:32 pm
Thanks JeffreyDriver, but that still isn't working on mobile.
Opera Touch is the only browser I found with it's own container.
Really need to figure out how to put the HTML5 in it's own container. I've got something 10 hours trying to figure
out how to get the HTML5 to center and zoom on mobile.
Apple is terrible.
1968
Posts: 103
September 24, 2019, 07:28:09 am
Hi guys!
Your advice helped.
Thanks!
Pages:
1