Trainz Objects in HTML Mini Browser

Status
Not open for further replies.

Christopher824

CDETrainz.com
If this post needs to be moved please do..

I have created a HTML asset, it's working great. I am having problems formatting the html web pages that use the <trainz-object> tag to format correctly in the Trainz Mini Browser. The object I am using is the Session Message Popup. This is the wiki that I am referring to;

http://online.ts2009.com/mediaWiki/index.php/MiniBrowser

No matter how I try to format the objects position, it always floats back up to the top left corner of the browser as seen here;

html message popup.png


Here is the code for when I tried to put the object in a table, I also tried it in the <p></p> tags;

Code:
<html>
<body>
    <table>
        <tr>
            <td><img src="CDETrainz.png"></td>
        </tr>
    </table>
    <p><b>CDETrainz.com</b></p>
    <p> </p>
    <p>Routes and Sessions for Trainz Railroad Simulator<br>Trainz T:ANE (TANE) and Trainz TRS 2019 (TRS19)</p>
    <p> </p>
    <p>Follow our Team on the Trainz User Forums</p>
    <table>
        <tr>
            <td><img src="Trainz Discussion Forum.png"></td>
        </tr>
    </table>
    <p>Trainz Forum Usernames;</p>
    <p>* Christopher824<br>* RockyRR</p>
    <p> </p>
    <p>
        <table>
            <tr>
                <td><trainz-object style=score-gauge star-thresholds=3 points=0 high-score=3></td>
            </tr>
        </table>
    </p>
</body>
</html>

Any help is appreciated.
 
Last edited:
Hi Chris

I haven't used the mini browser in TS2019 yet but the additional tags look interesting.

I don't know what you have tried but a couple of suggestions:
Add the height and width values to <trainz-object width=? height=? style=?> you already have the style. I suggest this as the score guage appears to be to big for the mini browser window.
Also try replacing <p> </p> code with <br> just to keep it simple - honestly I don't think this will help but I've seen stranger things happen :)

Good luck
 
Hi Chris

I haven't used the mini browser in TS2019 yet but the additional tags look interesting.

I don't know what you have tried but a couple of suggestions:
Add the height and width values to <trainz-object width=? height=? style=?> you already have the style. I suggest this as the score guage appears to be to big for the mini browser window.
Also try replacing <p>*</p> code with <br> just to keep it simple - honestly I don't think this will help but I've seen stranger things happen :)

Good luck

I am beginning to believe that the <trainz-object style=score-gauge ..> is defective

I tried all suggestions, and no luck. I tried two other <trainz-object>'s, the progress and the static-line objects. They work as expected with no issues placing them wherever I want them. Although the <p>..</p> and <br> tags both work as you would expect, I think using tables is easier to setup the page. You can even combine them all and it all still works.

Not documented is that the progress bar progress must be a decimal, ie. for 75% you enter 0.75 and must have a height and width to display. The static-line must have height, width, and color in RGB HEX ie. #RRGGBB (yellow is #FFFF00).

Sample code
Code:
<html>
<body>
    <table>
        <tr>
            <td><img src="CDETrainz.png"></td>
        </tr>
	    <tr>
	        <td><b>CDETrainz.com</b></td>
	    </tr>
        <tr>
            <td><trainz-object style=static-line color=#FFFF00 height=2 width=400></trainz-object></td>
        </tr>
        <tr>
            <td><trainz-object style=progress progress=0.7 width=200 height=20></trainz-object></td>
        </tr>
    </table>
</body>
</html>

Result;
html message popup 2.png




.
 
Hi Chris

I've had a look at this in TRS19. The Width height tags are important.

This worked for me

Code:
<html>
<body>
<trainz-object width=500 height=250 style=score-gauge star-thresholds=3 points=0 high-score=5> </trainz-object>
<br>
<p>Some text here</p>
<p>An image</p>
<img src="train.bmp">
</body>
</html>

Good luck
 
PS

The width and height are about the minimum that would work. You could probably reduce the height to 200 but I think the width is the most critical in this case.
 
Hi Chris

I've had a look at this in TRS19. The Width height tags are important.

This worked for me

Code:
<html>
<body>
<trainz-object width=500 height=250 style=score-gauge star-thresholds=3 points=0 high-score=5> </trainz-object>
<br>
<p>Some text here</p>
<p>An image</p>
<img src="train.bmp">
</body>
</html>

Good luck

Still floats to the top, I reordered your code a little to have text above the object, its still stuck on the top.

Code:
<html>
<body>
    <p>Some text here, more text, more text</p>
    <p>An image is an image is an image, where did it go?</p>
    <p><img src="CDETrainz.jpg"></p>
    <trainz-object width=500 height=250 style=score-gauge star-thresholds=3 points=0 high-score=5> </trainz-object>
    <br>
</body>
</html>

html message popup 3.png



PS

The width and height are about the minimum that would work. You could probably reduce the height to 200 but I think the width is the most critical in this case.

I have tried it with and without the height and width tags, they only change the size of the object and do not effect its operation, they do not help with the bug that it always floats to the top of the browser window.
 
Hi Chris
Sorry I couldn't be of more help.
But for what it's worth I have tested the placement of the gauge object and confirm what you are experiencing - the gauge always shows at the top of the mini browser window irrespective of the placement of the code to display the gauge.
Would be worth filling in a bug report with a link to this thread.
 
Hi Chris
Sorry I couldn't be of more help.
But for what it's worth I have tested the placement of the gauge object and confirm what you are experiencing - the gauge always shows at the top of the mini browser window irrespective of the placement of the code to display the gauge.
Would be worth filling in a bug report with a link to this thread.

Thanks for the help. I just submitted a help desk ticket Ticket ID #XWV-762-24410
 
I've never used the Trainz HTML code and mini browser. So I don't know what HTML codes it supports.

Since everything is inside a <table></table> I'm not certain how well the HTML "clear" will work. But you could try one of the following:

<img style="clear:both;" src="CDETrainz.jpg">

<img style="clear:right;" src="CDETrainz.jpg">

<img style="clear:left;" src="CDETrainz.jpg">


hope that helps
 
I've never used the Trainz HTML code and mini browser. So I don't know what HTML codes it supports.

Since everything is inside a <table></table> I'm not certain how well the HTML "clear" will work. But you could try one of the following:

<img style="clear:both;" src="CDETrainz.jpg">

<img style="clear:right;" src="CDETrainz.jpg">

<img style="clear:left;" src="CDETrainz.jpg">


hope that helps

The Trainz HTML has very few / basic tags only, plus some Trainz objects you can embed. Styles do not work.

https://online.ts2009.com/mediaWiki/index.php/MiniBrowser
 
Thanks Christopher824,

I think that using the style command in that fashion is possibly an HTML5 feature ... which made support unlikely. Thanks for the link.

I believe styles were introduced with HTML 3.0, there are some convoluted stories, Trainz HTML is all by itself, consider it HTML 1.0 or less. The 'styles' are the Trainz objects you can put on the page. The one that I can't figure out is the 'style=score-gauge'. That is what the post is about. I checked the Trainz Wiki page, and it has changed since I submitted a bug report, so I may have to retry my pages with different parameters, stay tuned.

Thanks for you interest
 
This thread seems to unnaturally attract spam, so I'm going to lock it.

If you have a legitimate response to the topic, report this post and for the reason ask for it to be unlocked.
 
Status
Not open for further replies.
Back
Top