Search Unity

Orthello 2D Framework - 100% FREE

Discussion in 'Assets and Asset Store' started by mas, Jul 7, 2011.

  1. ishaq

    ishaq

    Joined:
    Nov 12, 2008
    Posts:
    33
    thanks.

    one more question: I have an animating sprite that moves into the screen and starts playing an animation X. user can press "SKIP" and sprite moves out of the screen, I call Stop() on it.

    when I move the animation to the screen next time, it briefly shows last frame it was showing when user skipped it earlier. doesn't Stop reset the frameIndex?
     
  2. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    What happens if you destroy it completely using Destroy(sprite.gameObject) ?
     
  3. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Could be .. maybe animation resume related .. could be a bug ..
    Try to set the frame first before calling Stop();
     
  4. CINICGames

    CINICGames

    Joined:
    Aug 4, 2013
    Posts:
    7
    Hi,
    I'm using an OTTextSprite with a bitmap font that follows mouse movements. I need to obtain its height and width (depending on "Text" value) to handle the case where the text could go out of screen and so avoid it. Any suggests?
     
  5. Tix

    Tix

    Joined:
    Mar 5, 2013
    Posts:
    8
    Hi,

    First of all, thank you for this framework, it's really usefull :)

    I have a question. I'm trying to assign the image and xml file of my Sprite Atlas from the script, because these two file can be modify after the game compilation.

    I did the following:
    Then OT is trying to locate the xml file, but the path seems wrong and it fail to find it.
    Unfortunatly I can't assign the xml file directly because I can't create a TextAsset in runtime program.

    Is there another way to do that or am I missing something?

    Thanks!
     
  6. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Try : yourTextSprite.wordRect

    and make sure you call yourTextSprite.ForceUpdate right after you set the text because it takes 1 update cycle to adjust.
     
  7. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    It is only possible to set the dataFile (TextAsset) so you can only use code that supports that.
    And as we can not create one at runtime, it should be there at the start.

    or you will have to dive into the code and write some text string support into it.

    If you do .. I will be happy to include it into the core...
     
  8. Tix

    Tix

    Joined:
    Mar 5, 2013
    Posts:
    8
    Thank you so much for your answer. I think I'll try something else for now...

    I have two more questions:

    - my game is tile based, and my maps have more than 650 tiles (so 650 OTSprite in my scene). I want to use the sprite batching to create one or two big sprites, because loading 650 sprites can be very long. I did the same thing as explained on your website, but nothing really change, I still have all my sprites in my scene.
    I'm not sure how exactly the sprite batching works. Does it supposed to create one big sprite and delete the other 650 sprites?

    - when I create my tiled map, sometimes there is so gap between two tiles. The gap disappear when I move the camera, but other gap appear while moving. I think it's a display problem, but I don't know where to look to fix it.

    again, thank you and have a good day!
     
  9. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    please use the OTTilesSprite to create your tile based world ( example is in the Pro version )
    This sprite was especially created to support tile based games.

    regarding on how to use batching .. just check the examples and info on the online user manual .. but this is not
    meant to be used for lots of tiles...

    regarding the gaps on your tilemap. search on google for texel rounding issues in Unity.. you will find what is probably causing what you are seeing. Solutions could be to use 'point' filter mode on your textures or to use specific coordinate fractions when moving the camera.
     
  10. Tix

    Tix

    Joined:
    Mar 5, 2013
    Posts:
    8
    Ok, I'll try to work with those informations. Thank you for your time!
     
  11. Tix

    Tix

    Joined:
    Mar 5, 2013
    Posts:
    8
    Actually I have another problems. haha sorry to spam the thread!

    I'm trying to work with the OTTilesSprite, but I don't understand how to fill the grid from the script.

    I tried this:
    But I get a NullReferenceException, so it looks like the "tiles" array is not initiate...
     
    Last edited: Jan 6, 2014
  12. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    The tiles are dimensioned when the program awakes

    check..
    OTTilesSprite.Awake() calls DimTiles()

    so the only thing I can imagine is that you have not set the dimensions of the tilessprite correctly.
     
  13. Tix

    Tix

    Joined:
    Mar 5, 2013
    Posts:
    8
    I see! Actually I tried to create my map from a script in the editor so I don't have to load it in the game, I guess that was the problem. I works fine now.
    I was just wondering if it was possible to add colliders to specific tiles? (last question I promise :D )
     
  14. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    There is no automated system to attach colliders to specific tiles in the OTTilesSprite. I will put that on my todo for a next version. But until than you will have to write that code yourself.

    Position of a tile can be calculated so you should be able to create some collider system that will overlay the sprite.

    Check the CProExample - TilesSprite, where I put sprites ontop of (scrolling) tiles as the mouse hovers over them. The same way you could put colliders there. Be sure to to optimize you collider system so that adjecent rectangular collider areas are merged into one collider to prevent a huge (collider per tile) number of colliders.
     
    Last edited: Jan 8, 2014
  15. Tix

    Tix

    Joined:
    Mar 5, 2013
    Posts:
    8
    Okay great, I managed to do what I wanted. Thank you so much for your time ;)
     
  16. UDrew

    UDrew

    Joined:
    Apr 14, 2013
    Posts:
    6
    Hi mas!

    First off, I love Orthello! It's made my life so much easier! Thank you so much for making this and continuing to support it via these forums!

    I'm working on a project that uses pixel art style graphics and I'm trying to adjust the size of the pixels depending on the resolution:

    Original: 1 art pixel = 1x1 screen pixel (zoom = 0)
    Small: 1 art pixel = 2x2 screen pixel (zoom = 1)
    Medium: 1 art pixel = 3x3 screen pixels (zoom = ???)
    Large: 1 art pixel = 4x4 screen pixels (zoom = 2)

    I've been accomplishing this by using OT.view.alwaysPixelPerfect = true and changing the OT.view.zoom depending on the resolution. My problem is, I can't figure out what to set the zoom at to get true 3x3 pixels. I initially thought zoom = 1.5 would do it, but only some pixels are 3x3 and others end up being 2x3 or 3x2. They're rectangular shape is no good for pixel art. I tried playing with the zoom and I can't get all the pixels to be 3x3. Can you tell me what the zoom should be set at to accomplish this or is there another way I can tell Orthello to scale each art pixel to whatever dimensions I want? Thanks!
     
  17. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    zoom factor of 1.5 should give you the right size. I can only imaging that the 3x2 pixels are rounding issues maybe related to the original size of you sprites. What sprites do have 3x3 pixels and what sprites do not .. what are their original sizes ..


    Another approach would be to specifiy your working (reference) resolution (OT.view.pixelperfectResolution) and set OT.view.alwaysPixelPerfect to false. This way the sprites are pixelperfect on a device that has your reference resolution and the camera is zoomed automaticly to the right size on other resolutions.
     
    Last edited: Jan 15, 2014
  18. UDrew

    UDrew

    Joined:
    Apr 14, 2013
    Posts:
    6
    Thanks for the fast reply! It could be a rounding issue, not sure if the sprites are the issue, unless there's a setting I'm missing or something. The project has a board of 32x32 tiles, surrounded by a border made up of 16x16 tiles, totalling 416x192 for the whole board. I'd like to be able to scale the 32x32 to 96x96 (3x zoom) without having to make separate images just for this zoom. I can get them to scale to 64x64 and 128x128 but it doesn't want to do 96x96 quite right.. So if you see anything wrong there that I'm missing, please let me know. I can provide screen shots later (when I get home) if you need to see it happening.

    I have tried playing around with the pixel perfect resolution, but I ran into the same issue. I can try playing with that more tonight. When I did use that, I found that more resolutions would run into that issue since they're not the always the same aspect ratio, so zooming seemed to work best.
     
  19. UDrew

    UDrew

    Joined:
    Apr 14, 2013
    Posts:
    6
    FYI, I was able to find a solution. Using a combination of pixel perfect zoom worked for some resolutions (as I had mentioned before), but I wasn't able to find a setting that satisfied ALL the resolutions that I need to support. I was able to find an OT.view.pixelperfectResolution that got the Medium resolution to display correctly. So I just put together some code to turn pixel perfect on off depending on the resolution. Overall, I do think it was a rounding issue, but I'm just happy I got it to work. Thanks again!
     
  20. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Nice Find!
    Keep up the good work!
     
  21. CINICGames

    CINICGames

    Joined:
    Aug 4, 2013
    Posts:
    7
    Hi mas,
    I'm need to attach some OTSprite objects to the camera (like a GUI would works). I tryed with parenting:

    MyOTSpriteObject.transform.parent = Camera.mainCamera.transform;

    looking at the editor window, when I move the camera my sprites moves correctly but parenting them to the camera make them not visible to screen. I tried parenting the OT.view and I had the same results. I looked at the Orthello2D doc and I found the "ChildOf" method, but the camera is not a GameObject or a OTSprite. How can I fix it?

    Thanks :)
     
  22. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Best approach would be to use a clipArea sprite or a second camera to project a 2nd view ontop of your screen.
    Attaching to the camera will be kind of tricky.

    But if you do .. keep in mind that the depth of you sprites is parent related so a negative value would set them before the camera.
     
  23. CINICGames

    CINICGames

    Joined:
    Aug 4, 2013
    Posts:
    7
    Thanks a lot, now I know why my sprites were not visible on screen :)

    Btw, I attached my sprite to the OT.view:

    MyOTSpriteObject.transform.parent = OT.view.transform;

    If someone uses this approach, keep in mind just 2 things:

    1) OT.view depth is equal to -1000, so if you want your sprite at -150, you have to set the depth to 850 (-1000 + 850 = -150)
    2) OT.view pivot is at the center (0,0)

    Thanks again mas :D
     
  24. Tbug

    Tbug

    Joined:
    Jul 10, 2012
    Posts:
    3
    Hi,

    How i can use OTSpriteBatch.Build() directly in the editor, to have prebatch object and avoid Heap on runtime when big batch objects are enable for the first time.

    the other solution is to init Objects to batch before start the game, but a prebatch can be great !, to instantiate prefab without batch heap.

    Edit : Now my objective is to kill Rebatching, I search to have one batch on each objets on scene Start and Stop batching when object become passive/active, I see the previous version of Otspritbatch have monitor function to stop autobatching not in the actual version.

    Edit 2 : Disable Otspritbatch after the first batch work perfectly.


    thanks , and sorry for my english ^^.
     
    Last edited: Mar 10, 2014
  25. Unnumeric

    Unnumeric

    Joined:
    Jun 3, 2013
    Posts:
    9
    Hi I love using Orthello. However I'm having a few problems using Filled Sprites. With some images they are filling up and repeating the pattern. Other images cause it to fill a small bit in the corner and the rest to be transparent. Unless there is a filled pixel on the edge of the image, in which case it is smeared across the whole tile.

    Any ideas?
     
  26. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Good to hear that you solved it.
     
  27. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696

    I do not have a clue .. can you show some screenshot of what you are experiencing?
     
  28. CINICGames

    CINICGames

    Joined:
    Aug 4, 2013
    Posts:
    7
    Hi mas,
    I have a problem about my compiled game. When I run it in the editor the graphics is pretty clean but in my .exe look really noised. I played to settings (I guess quality/player setting) and I made something wrong that causes what you see in the screenshot, I guess. Maybe I changed something different and I don't remember, I don't know. Btw, in the editor everything still works OK. I reset the quality settings of "Good" (the one I think I used by default before this mess) but I already have the "noise" problem.

    $Screen 1.png

    Hoping you can help me, I'm really next to finish my Unity3d porting and this problem drives me crazy!
     
  29. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Most of the time distorted graphics are due to texel rounding or texture compression. So check your texture import settings for your platforms.
    Maybe it is reduced in size on publish or some texture are not set to GUI. In my experience it is always the importer.

    hope this helps...
     
  30. brobotic

    brobotic

    Joined:
    Apr 8, 2014
    Posts:
    1
    Loving this addon, so much that I bought Pro.

    Having a roadblock at the moment with importing TILED maps.

    I have a 128x128 tileset, each tile being 32x32. I imported this into Tiled(with same dimensions), and followed the User Manual's guide to setting up TILED to export proper data. My XML sheet is identical to the one in the JS Example(without the properties). My goal is to just see the tileset on screen, which I haven't been able to get working right. I read the documentation and have googled around but haven't found much.

    Here's what I do:
    Set size 1136x640(iPhone 5 resolution)
    Drag TileMap prefab to scene
    Set Tile Set Image Size to 1 and load the tileset
    Import XML
    Nothing happens
    No Mesh renderer or Material is on the object

    I don't see any data in the Layers component of the TileMap prefab. It's as if the XML data isn't imported properly. When I look at the example, the same component is filled in with 600 elements that each represent a tile. But on my scene, Layers is empty.

    Any help would be great, thanks.
     
  31. mas

    mas

    Joined:
    Nov 14, 2010
    Posts:
    696
    Can you send an example project that demonstrates your problem as a unitypackage to our support email addresss ( info at wyrmtale dot com) ? This way I can have a look what is going on.
     
  32. Inspy

    Inspy

    Joined:
    May 30, 2014
    Posts:
    4
    Hi mas and everybody,

    I'm very new in Unity here. So I'm developing a 2D turn-based RPG game for mobile with a bunch of possible characters (300+). In the battle scene, I never know which sprite/animation I have to display beforehand. So everything comes from run-time.

    Yesterday I have downloaded Orthello tool for 2D sprites and it looked great. However, it seems that in Orthello I have to put all containers/animations/prototypes in the project hierarchy to make it works. And for my case, it will be bunch of objects I have to put in there since there are more than possible 300 characters for the battle scene in my game, let alone back ground images and other stuffs. So I'm pretty worried about memory usage and all the messy things in hierarchy. My initial thought was that I would solve this problem with "Resources.load()" but I'm not sure if it will work with Orthello. Or do I really need to use "Resources.load()" for this ? Do all the objects in project hierarchy load when I start the scene ? Can I still work with Orthello for this kind of game ?

    Any help/suggestion for me ?

    Thank you very much in advance :)
     
  33. iPicnic

    iPicnic

    Joined:
    Apr 8, 2014
    Posts:
    6
    Hi! I'm having a huge issue using OTTween in my app on iOS.

    I got this error bellow:

    ExecutionEngineException: Attempting to JIT compile method 'System.Reflection.MonoProperty:GetterAdapterFrame<OTObject, UnityEngine.Vector2> (System.Reflection.MonoProperty/Getter`2<OTObject, UnityEngine.Vector2>,object)' while running with --aot-only.

    at System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index) [0x00000] in <filename unknown>:0

    at OTTween.SetVar (System.String name) [0x0006f] in Assets/Orthello/Standard Assets/OT/Tweening/OTTween.cs:326

    at OTTween.Tween (System.String var, System.Object fromValue, System.Object toValue, .OTEase easing, .OTEase pongEasing) [0x00018] in Assets/Orthello/Standard Assets/OT/Tweening/OTTween.cs:627

    at OTTween.Tween (System.String var, System.Object toValue) [0x00000] in Assets/Orthello/Standard Assets/OT/Tweening/OTTween.cs:701


    (Filename: Assets/Orthello/Standard Assets/OT/Tweening/OTTween.cs Line: 326)


    ArgumentOutOfRangeException: Argument is out of range.

    Parameter name: index

    at System.Collections.Generic.List`1[OTEase].get_Item (Int32 index) [0x00000] in <filename unknown>:0

    at OTTween.Update (Single deltaTime) [0x000f7] in Orthello/Standard Assets/OT/Tweening/OTTween.cs:503

    at OTTweenController.Update () [0x0000d] in Orthello/Standard Assets/OT/Tweening/OTTweenController.cs:61

    at OTController.Update (Single pDeltaTime) [0x00031] in Orthello/Standard Assets/OT/_Base/OTController.cs:162

    at OT.Update () [0x0051e] in Orthello/Standard Assets/OT/_Base/OT.cs:2613

    (Filename: Orthello/Standard Assets/OT/Tweening/OTTween.cs Line: 503)


    I can't figure out why it's happening, can you help me @mas ?

    it's only happens when I use it with Api Compatibility Level .NET 2.0. in .NET 2.0 subset the error doesn't happen, but I need the full .NET 2.0 because I set OTAtlas in runtime.

    The size tween is also not scaling around its pivot, it ever scale at top left. I tested it with an sprite, it doesn't work well. The older version of Orthello it was working.
    I commented the line 1261 //offset = _baseOffset; at OTObject and now it works well.
     
    Last edited: Jun 26, 2014
  34. Avestas

    Avestas

    Joined:
    Jun 8, 2013
    Posts:
    17
    Hi Mas, I got the following problem, hope you can help me:

    I have to put the Orthello-folder into the Standard-Assets folder, in order to be able to run my game, as I am using Javascript, and the Standard-Assets are compiled earlier (you know these problems).

    I wanted to give my game a try an tried compiling it, but I get the error:"Assets/StandardAssets/Orhtello/and/So/Forth/OTAssetPostProcessor.cs(2,7:error CS0246: The type or namespace name 'UnityEditor' could not be found. Are you missing a using directive or an assembly reference?"

    I looked that up, but while not being familiar with C#, I am not sure how to handle that. I found out, that these scripts/OT have to be in a folder named Editor, but then my Javascript references do not work anymore...
    (And I do not want to rip the OT-Folder structure apart).

    I hope you can help my and thanks in advance!


    Sincerely Avestas:

    BTW: OT is an awesome package!

    SOLVED: Putting the Scripts in a folder named Editor in the Main Hierachy solved it! No consecutive errors came up...
     
    Last edited: Sep 24, 2014
  35. CINICGames

    CINICGames

    Joined:
    Aug 4, 2013
    Posts:
    7
    Hi mas,
    I use spritesheet for storing my frame by frame animations. Now I want to put all these animations in a OTSpriteAtlasCocos2D, so I need a way to get the Texture2D of an atlas frame so I can set it to the animation sheet container. Any suggest?

    Thanks
     
    Last edited: Apr 5, 2015
  36. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    393
    Hi

    Does this framework support pixel perfect for the tilemaps or for the sprites only?

    Thanks for advance.
     
  37. GBA_awesomekid

    GBA_awesomekid

    Joined:
    Feb 7, 2021
    Posts:
    1
    so dose http://www.wyrmtale.com still exist because i cant get in it keeps saying i got poor connection but i dont