Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

HTMLEngine v001

Discussion in 'Assets and Asset Store' started by UnityDigger, Jun 6, 2012.

  1. UnityDigger

    UnityDigger

    Joined:
    Nov 20, 2011
    Posts:
    79
    Hi!

    Now opensource: http://code.google.com/p/html-engine-mini/

    Short description:

    Its free under MIT license.

    HTMLEngine renders html-formatted text as fast as it possible.
    Engine can be used not only with Unity3D. Implementation easily can be done also for XNA (2,3,4), WinForms, WPF, Silverlight, anywhere on .net/mono platform.
    Android, iOS? No problem i think.

    Supported tags:
    <a href='yourlink'> - for links
    <img src='imagesource' [width=... height=...]> - for images and hardcoded stuff
    <p [align=...][valign=...]> - for formatted paragraphs
    <br> - for linebreaks
    <font [face=...] [size=...] [color=...]> - for fonts
    <code> - same as <font face=code>
    <b> - for bold
    <i> - for italic
    <u> - for underline
    <s> - for strike
    <effect> - for one of text effect


    (click to zoom in)

    Online demo: http://profixy.ucoz.com/demo2/WebPlayer.html
    You can download unitypackage of that demo here: http://profixy.ucoz.com/unitypackage/HTMLEngineV1.zip
    Licensing discussion here: http://forum.unity3d.com/threads/138051

    Any bugs, questions?
     
    Last edited: Jun 20, 2012
  2. DEtH_MoroZ

    DEtH_MoroZ

    Joined:
    Nov 22, 2011
    Posts:
    43
    Nice, keep it up!
     
  3. liverolA

    liverolA

    Joined:
    Feb 10, 2009
    Posts:
    347
    Really useful,please keep up!
     
  4. UNITY3D_TEAM

    UNITY3D_TEAM

    Joined:
    Apr 23, 2012
    Posts:
    720
    i dont know how to use please give any video tutorial; to learn.ty
     
  5. UnityDigger

    UnityDigger

    Joined:
    Nov 20, 2011
    Posts:
    79
    Sorry, i have no free time for that for now.

    Just import given unitypackage into empty project and look into source code (HtmlBehaviour.cs at least). There is comments. I hope understandable comments.
    After that fell free to ask questions if something is not clear there.
     
  6. Dude882008

    Dude882008

    Joined:
    Apr 1, 2009
    Posts:
    3
    Hello,
    This project is awesome. You did a great job!

    I have been messing with it and added support to load images remotely. I wanted to start adding more tag support. Is there any chance you may opensource this project, mainly the dll?

    Also I have interest in compiling this for iOS platform, is there any reason you can think of that this would not be possible?

    Thanks,
    Dan
     
  7. UnityDigger

    UnityDigger

    Joined:
    Nov 20, 2011
    Posts:
    79
    Thanks.
    Not yet. What tags you need? Interesting.
    There is native .net assembly, why it must be recompiled for iOS?
    Android work with that without problem.
     
  8. Dude882008

    Dude882008

    Joined:
    Apr 1, 2009
    Posts:
    3
    I wanted to try to ad some support for tags like ul, li and em.

    I also wanted to explore the possibility of adding background images.
     
  9. UnityDigger

    UnityDigger

    Joined:
    Nov 20, 2011
    Posts:
    79
  10. UnityDigger

    UnityDigger

    Joined:
    Nov 20, 2011
    Posts:
    79
    SVN updates. Another graphics toolkit added.
     
  11. dev_peter

    dev_peter

    Joined:
    Aug 9, 2012
    Posts:
    38
    any chance that you could make an ios version?
     
  12. UnityCoder

    UnityCoder

    Joined:
    Dec 8, 2011
    Posts:
    534
    Thank u very much for providing such a good tool.

    I have one question that is it possible to use it with 3D Text ?
     
  13. UnityDigger

    UnityDigger

    Joined:
    Nov 20, 2011
    Posts:
    79
    there is no platform specific code/assets/shaders
    everything is C#, so just compile it for any target
     
  14. UnityDigger

    UnityDigger

    Joined:
    Nov 20, 2011
    Posts:
    79
    Thanks.

    look into HTMLEngine.Unity3D/HtmlImage.cs
    there is example for special case <img src="#time">
    you can implement any logic same way, even place/scale 3D object into given screen coords
     
  15. dev_peter

    dev_peter

    Joined:
    Aug 9, 2012
    Posts:
    38
    I've tried to compile it with Monodevelop (no error messages) but I'll end up with:

    Code (csharp):
    1. Aug 15 12:26:31 unknown UIKitApplication:com.x.test[0x1526][3354] <Notice>: - Completed reload, in  0.045 seconds
    2. Aug 15 12:26:31 unknown UIKitApplication:com.x.test[0x1526][3354] <Notice>: -> applicationDidBecomeActive()
    3. Aug 15 12:26:31 unknown UIKitApplication:com.x.test[0x1526][3354] <Notice>: Initializing Demo
    4. Aug 15 12:26:31 unknown UIKitApplication:com.x.test[0x1526][3354] <Notice>:  
    5. Aug 15 12:26:31 unknown UIKitApplication:com.x.test[0x1526][3354] <Notice>: (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)
    6. Aug 15 12:26:31 unknown UIKitApplication:com.x.test[0x1526][3354] <Notice>: Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for HTMLEngine.OP`1 ---> System.MissingMethodException: Method not found: 'Default constructor not found...ctor() of HTMLEngine.HtCompiler'.
    7. Aug 15 12:26:31 unknown UIKitApplication:com.x.test[0x1526][3354] <Notice>:   at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in <filename unknown>:0
    8. Aug 15 12:26:31 unknown UIKitApplication:com.x.test[0x1526][3354] <Notice>:   at System.Activator.CreateInstance (System.Type type) [0x00000] in <filename unknown>:0
    9. Aug 15 12:26:31 unknown UIKitApplication:com.x.test[0x1526][3354] <Notice>:   at System.Activator.CreateInstance () [0x00000] in <filename unknown>:0
    10. Aug 15 12:26:31 unknown UIKitApplication:com.x.test[0x1526][3354] <Notice>:   at HTMLEngine.OP`1[HTMLEngine.HtCompiler].CreateInstance () [0x00000] in <filename unknown>:0
    11. Aug 15 12:26:31 unknown UIKitApplication:com.x.test[0x1526][3354] <Notice>:   at HTMLEngine.OP`1[HTMLEngine.HtCompiler]..ctor (Int32 capacity) [0x00000] in <filename unknown>:0
    12. Aug 15 12:26:31 unknown UIKitApplication:com.x.test[0x1526][3354] <Notice>:   at HTMLEngine.OP`1[HTMLEngine.HtCompiler]..cctor () [0x00000] in <filename unknown>:0
    13. Aug 15 12:26:31 unknown UIKitApplication:com.x.test[0x1526][3354] <Notice>:   --- End of inner exception stack trace ---
    inside OSX its running fine. But it'll crash on an ipad
     
  16. UnityDigger

    UnityDigger

    Joined:
    Nov 20, 2011
    Posts:
    79
    is "Stripping Level" disabled?
     
  17. dev_peter

    dev_peter

    Joined:
    Aug 9, 2012
    Posts:
    38
    thats it! now its working. Thanks
     
  18. devain

    devain

    Joined:
    Jul 7, 2012
    Posts:
    14
    The link to the package seems broken - any chance anyone has it lying around?
     
  19. loadexfa

    loadexfa

    Joined:
    Sep 2, 2008
    Posts:
    214
    I just tried, it worked fine for me. Here are the instructions for checking out from svn:

    svn checkout http://html-engine-mini.googlecode.com/svn/trunk/ html-engine-mini-read-only

    EDIT
    <facepalm>
    You said Unity Package, I should have read your post more carefully. :) The download link is broken for me too and I second your request for this.
     
    Last edited: Oct 13, 2012
  20. dsavatar

    dsavatar

    Joined:
    Oct 12, 2012
    Posts:
    6
    Hi!

    Can someone share unitypackage of HTMLEngineV1.zip

    Thanks
     
  21. UnityDigger

    UnityDigger

    Joined:
    Nov 20, 2011
    Posts:
    79
    Site restored. For now. Ucoz disables site for inactivity. ;)
     
  22. stoyannk

    stoyannk

    Joined:
    Oct 30, 2012
    Posts:
    35
    Very nice work man, I know how difficult an HTML parser and the renderer could become. Covering the whole standard would be a pharaonic task even if you skip HTML5 and CSS3.
    I read about your performance problems. IMO a competitive solution would always need native code for all parts of the flow - parsing, layout, rendering.
     
  23. Yann

    Yann

    Joined:
    Oct 20, 2007
    Posts:
    432
    Excellent initiative, congrats ! Any chance to see a ready-to-use package appear on the Asset Store soon ?
     
  24. gtzpower

    gtzpower

    Joined:
    Jan 23, 2011
    Posts:
    307
    I added this to my Unity project, and I love it! Only one hitch. When I try to build and run on my iPhone5, I get the following error:

    Code (csharp):
    1. /Users/jade/Project/Libraries/HTMLEngine.dll.s:33480:1: error: invalid symbol redefinition
    2. plt__class_init_System_Collections_Generic_EqualityComparer___:
    3. ^
    4. Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

    Any thoughts?
     
  25. UnityDigger

    UnityDigger

    Joined:
    Nov 20, 2011
    Posts:
    79
    Try to disable "Stripping Level", as suggested in this thread.
     
  26. UnityDigger

    UnityDigger

    Joined:
    Nov 20, 2011
    Posts:
    79
    Thank you.

    Asset Store - not yet. Just copy sources (or compiled dll) and some fonts and go on.

    Have no free time last months.
     
  27. JamesArndt

    JamesArndt

    Unity Technologies

    Joined:
    Dec 1, 2009
    Posts:
    2,880
    Wow awesome! Thanks for sharing!
     
  28. tolstenko

    tolstenko

    Joined:
    May 31, 2012
    Posts:
    14
    Awesome! Great stuff! :) bookmarked to be used in my next project
     
  29. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,357
    Any chance of supporting <div> tags?
     
  30. puorcunicu

    puorcunicu

    Joined:
    Aug 25, 2012
    Posts:
    1
    Hi, I've the same gtzpower 's error in Xcode :

    " HTMLEngine.dll.s:33480:1: error: invalid symbol redefinition
    plt__class_init_System_Collections_Generic_EqualityComparer___:
    ^ "
    I've not idea how to found the solution. I exported the project from unity with "Stripping Level" desabled.
    I'm disperate!!!
    if someone can help me please!!!
     
  31. Fabian-Haquin

    Fabian-Haquin

    Joined:
    Dec 3, 2012
    Posts:
    231
    One year later but to make this work on IOS you have to download the sources with svn: https://code.google.com/p/html-engine-mini/source/checkout

    Then you juste have to replace your HTMLEngine.dll with the content of the folder HTMLEngine.
    (just ignore HTMLEngine.Unity3D, HTMLEngine.WinForms and HTMLEngine.XNA4).

    You will have 3 compilations errors in Unity, just comment them, here you go!

    (Tested on IOS 8, Android and Editor).
     
unityunity