Page 2 of 2

Re: Implement ManiaLinks in VisualBasic-Software?

Posted: 18 Feb 2016, 19:25
by TheM
ManiaDesign wrote:
Electron wrote:
ManiaDesign wrote:Thanks for the answer, but the idea was, to view manialinks without maniaplanet in a software. Do you think it's possible?
It is possible. Search for Manialink Designer and Manialinks Editor, two WYSIWIG Manialink editors for TM1 as further examples.

But such a project needs a lot of planning. You need to consider how to implement the xml elements, how to translate the coordinate system, implement the layers, support style sheets and so on.
Puhh, that sound like many work... Maybe I do it^^
Well, you want to make a project, so you have to put in some effort.
Don't expect everything to be handed to you on a silver platter here... :thumbsup:

Re: Implement ManiaLinks in VisualBasic-Software?

Posted: 18 Feb 2016, 21:44
by Florenzius
Yea, i know, but i thought, it's easier^^ :mrgreen:

Re: Implement ManiaLinks in VisualBasic-Software?

Posted: 19 Feb 2016, 00:34
by zocka
A web client would be really preferable, as it's platform independent, you can more or less recreate many styles with basic css etc.
You could basically translate most elements 1:1 to html elements, wouldn't have too much of a struggle of parsing all elements first, then thinking about stuff like draw order because your browser does all the work for you: Since Manialinks have a fixed grid, you can position everything absolutely in the browser with z-index, use transforms etc :thumbsup:

For TMF there was this collection of styles: http://fish.stabb.de/styles/
As I once tackled the project of a Manialink viewer for TMF, I got all the pngs on that list from fish (the images without this mirror effect), but I don't know of a comparable source for TM2 styles.

What you should consider with Manialinks though is that you basically would have to compile the associated ManiaScript as well, in case the content (like translated text) is loaded via script, elements are hidden by default etc. For example you manage to render a landing page which consists of a background image and a button and that's it for your viewer, which I wouldn't really call a success.

After some thoughts about such a project I shelved it :D

Re: Implement ManiaLinks in VisualBasic-Software?

Posted: 19 Feb 2016, 04:01
by w1lla
http://maniaviewer.tm-ladder.com/ was something useful and can be achieved if people are interested might need to update the sources

Re: Implement ManiaLinks in VisualBasic-Software?

Posted: 19 Feb 2016, 09:43
by Miss
I've been thinking of writing a Manialink to HTML renderer a few days ago, actually, haha

Re: Implement ManiaLinks in VisualBasic-Software?

Posted: 19 Feb 2016, 09:50
by Florenzius
zocka wrote:A web client would be really preferable, as it's platform independent, you can more or less recreate many styles with basic css etc.
You could basically translate most elements 1:1 to html elements, wouldn't have too much of a struggle of parsing all elements first, then thinking about stuff like draw order because your browser does all the work for you: Since Manialinks have a fixed grid, you can position everything absolutely in the browser with z-index, use transforms etc :thumbsup:

For TMF there was this collection of styles: http://fish.stabb.de/styles/
As I once tackled the project of a Manialink viewer for TMF, I got all the pngs on that list from fish (the images without this mirror effect), but I don't know of a comparable source for TM2 styles.

What you should consider with Manialinks though is that you basically would have to compile the associated ManiaScript as well, in case the content (like translated text) is loaded via script, elements are hidden by default etc. For example you manage to render a landing page which consists of a background image and a button and that's it for your viewer, which I wouldn't really call a success.

After some thoughts about such a project I shelved it :D
Thanks for your post :)

But for a web-client i have to learn xml + html, right? Thanks for the style-table. So is it possible to include these graphics in the html-code? Cos if not, there will be errors, because it don't finds the graphics from the code...

For the convert from XML to HTML i found some online-converters like this one: http://codebeautify.org/xml-to-html-converter

I hope i found the solution :)

Regards,
Flo

##EDIT 1## Lel, i converted a titlepack-menu-xml-file to html and there was no errors. But it doesn't looks like a interface of MP

http://i.imgur.com/jfxR2kR.png

Please... No shitstorm, i did read your posts and I know it doesn't works with maniaplanet fine, but i just wanted to test it, okay?

##EDIT 2## I just found this tutorial to convert a xml-file to a web-page(i think html). It's from microsoft and I'm not sure, wheter they use sharepoint...? I just installed it but i need a web-server on the sharepoint-foundation etc. :|

Here the link: https://support.office.com/en-US/articl ... #bmbennies

Re: Implement ManiaLinks in VisualBasic-Software?

Posted: 19 Feb 2016, 11:59
by zocka
XML and HTML aren't really languages to learn. It's markup. What you had to learn would be CSS and JavaScript. To process the input you can use almost any other language you are comfortable with.

The links you dug up seem to aim at displaying data sets structured in XML documents.

It seems you have the wrong impression of what you need to do.

You would need to load the XML of the Manialink with some kind of Interpreter that allows you to iterate through the elements.
Based on what kind of XML node you are currently processing, you then create an element with fitting attributes. If you would really want to produce HTML code, have a look at this pseudo code:

Code: Select all

def _createHtmlCode(xmlNode):
  if (xmlNode.name == "label"):
    return _createLabelHtml(xmlNode)
  if (xmlNode.name == "frame"):
    return _createFrameHtml(xmlNode)
  ...

def _createLabelHtml(xmlNode):
  element = new XmlNode('span')
  element.attributes.text = xmlNode.attributes.text
  element.attributes.class = xmlNode.attributes.style
  ...
  return element

def _createFrameHtml(xmlNode):
  element = new XmlNode('div')
  element.attributes...
  for (node in xmlNode.children):
    element.children.push(_createHtmlCode(node))
  ...
I hope you get the idea of it.

To scale things, I would write the original values somewhere into the elements and later scale everything with JavaScript based on that, so you can react on window resizes etc.