Giter Club home page Giter Club logo

ex2d's Introduction

Welcome to ex2D Documentation!

ex2D is an Unity3D plugin providing fast 2D rendering solution and working pipeline. The plugin including a 2D rendering framework based on Unity3D Mesh classes, and designed several editors working together with the 2D render engine. It is highly optimized for mobile devices.

This documentation will walk you through in a few easy steps, to help you start rocking Sprites in Unity! You will also find runtime and editor scripting reference for all of ex2D classes.

Links

License

The source code in this repository can only be used for the purpose of understanding and learning how ex2D runtime classes work. You are only allowed to include these source code in your commercial and non-commercial projects if you have got the ex2D standard/evaluation license.

You are not allowed to sell these code in any form.

ex2d's People

Contributors

jwu avatar steinbitglis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ex2d's Issues

Bugs with the new version of Unity 3.5.5f2

Some of my exSprites lost it's texture "connection" and I need to rename the texture and select it again on the affected Sprites. The textures are in the correct folder (was working perfectly before the update) but they aren't in the Project tab on Unity.
I really don't know if this is something related do Ex2D or if it's a Unity Bug.

Bug - changing the size of a sprite outside isn't updated well by ex2D

For example :
I have an image which is 32_32 px large and create an atlas where this image is.
Later on, I want to change the size of this image to, say, 45_45 px. Now, ex2D seems to oversize or, in any case, to change the real size of the image and it's a pain in the ass to correct this. ( I've tried the workaround about the custom size checkbox but it doesn't really resolve the problem )
:/

Pixel perfect sprites aren't resized when spawned in the Scene view

Our game is a 2D side-scrolling autorunner that uses a single orthographic camera. The camera size is set to 3, which gives us a conversion rate of 128px / 1 unit.

Most of our sprites are set to 'Pixel Perfect' with a uniform scale of 1. The first time a scene is loaded that contains a sprite with these settings, it shows up in the Scene view at an absurdly large scale, oftentimes obscuring the whole level. This also occurs if you duplicate an existing object with a pixel perfect sprite - the newly created object is blown up to roughly 128 its normal size (due to our conversion of 1 unit to 128px, I imagine).
Clicking the 'Rebuild' button on the exSprite component or switching to the Game view and back again causes the sprite to be resized to its proper dimensions.

It looks as if there's some bug in the Pixel Perfect script, like maybe it doesn't perform its resizing on awake or something like that. When running the game itself, everything looks fine; this is only a problem the first time assets show up in the Scene view.

We're running Unity 3.5.4f1 with ex2D 1.2.0.

Sprite Font Fix Width Layout

Need somehow to keep the text flow confined to an area/rect/width. I need to be able to specify a given line width in pixels/units, have ex3D split the text into multiple lines according to this width, and query the height of the complete text. This is great for scrollable text fields.

Pixel Perfect Can Manually Assign Screen Resolution

For 2D games that cannot use 1 pixel = 1 unit scale, it would be handy to enable manually screen resolution set up in Pixel Perfect component.

We have received issue report from user whose aiming resolution is something like 800*480. But this resolution cannot be easily previewed in Unity.

We should add a checkbox in Pixel Perfect component and let user choose to use current viewport size or custom size.

Atlas Editor - padding error

I have a picture with a width of 1024 pixels and the atlas texture is 1024 pixels as well. if you set a padding value the texture can't fit in the atlas. So, I think you must calculate the space left in the atlas to apply the padding for this texture.

Texture rectangle is out of bounds
UnityEngine.Texture2D:SetPixels(Int32, Int32, Int32, Int32, Color[])
exTextureHelper:Fill(Texture2D, Vector2, Texture2D, Rect, RotateDirection, Boolean, Color)
exAtlasInfoUtility:FillAtlasTexture(Texture2D, exAtlasInfo, Boolean)
exAtlasInfoUtility:Build(exAtlasInfo, Boolean)
exAtlasEditor:OnGUI()
UnityEditor.DockArea:OnGUI()

Bug in Prefab - ex2D Daily Fix Build v1.2.6 Beta For Unity 3.5.4 (120706)

Prefab build with from Sprite when you view throws an error

NullReferenceException: Object reference not set to an instance of an object
exPixelPerfect.UpdatePixelPerfectCamera (.exPixelPerfectCamera _ppfCamera)
exPlane.set_renderCamera (UnityEngine.Camera value)
exPlane.get_renderCamera ()
exPlaneEditor.OnInspectorGUI ()
exSpriteBaseEditor.OnInspectorGUI ()
exSpriteFontEditor.OnInspectorGUI ()

Dynamic Lighting normal not correct when flipping

http://forum.unity3d.com/threads/101811-ex2D-the-best-2D-sprite-solution-for-Unity-RELEASED?p=903612&viewfull=1#post903612

Hi!

It seems that the lighting does not work correctly for ex2D sprites with H-flip or V-flip on (sprites seems to be ok when both flips are off or both are on). I'm using standard diffuse/transparent diffuse shaders.

In my game, I'm using four ex2D sprites to create the background in the way that they are rotated/flipped (example: a texture have one quarter of circle, with flipping, you can create whole circle with four sprite objects and one texture by using flip/rotation -> your level background requires only 1/4 of the memory when compared to one big texture)

Br,

  • Moopi

Add a Collision Mesh Editor like the one in Torque2D

Missing Reference Exception

Hey again guys,

Well I am sorry to say but ex2D is still a "no go" in Unity beta. I constantly get:

"MissingReferenceException: The object of type 'Texture2D' has been destroyed but you are still bring to access it."

This bug is preventing me from using it with 3.5 as stated before.

Switching seamlessly between animations

Currently, there's a lot of code required to switch between two parallel animations.
Something like the following.

ca = animations.GetCurrentAnimation()
if ca:
    # Set time to what it was before switching animation
    t = ca.time
    animations.Play( turned_animation )
    animations.GetCurrentAnimation().time = t

    # Update immediately
    fi = animations.GetCurFrameInfo()
    if fi:
        sprite.SetSprite (fi.atlas, fi.index)
        sprite.Commit()

This is not even a solution, because any events that have played during the first part of the animation, will now be repeated.

I wish I could just do this:

ca = animation.GetCurrentAnimation()
animations.Play(turned_animation, ca.time) if ca

And only events after animation.GetCurrentAnimation().time should trigger, as expected.

Substitute color in AnimationHelper should execute in LateUpdate() not Update().

As title, the logic for substituting color in every AnimationHelper have the same problem.

Because Unity's animation system samples between Update() and LateUpdate().

Say, I create a prefab that contains a sprite with alpha = 1, and attach an auto-played animation which starts from alpha=0.
When I instantiate the prefab, it should act as a fade-in sprite.

But in this situation alpha in the first frame will be 1 (The Animation samples 0, but hasn't substituted by AnimationHelper).
So there will be a 'blink artifact' while fading in.

" there is no script with that name" error when build for iOS

I am using the evaluation version 1.2.0. It is for the iOS platform. I tried building to the device and experienced 4 errors:

Instance of exSpriteEditor couldn't be created because there is no script with that name.
Instance of exLayerXYEditor couldn't be created because there is no script with that name.
Instance of exSpriteAnimationEditor couldn't be created because there is no script with that name.
Instance of exCollisionHelperEditor couldn't be created because there is no script with that name.
UnityEditor.HostView:OnGUI()

I checked and I have these files inside of my project view in the ex2D/Editor/ex2D.Editor directory.

It still is capable of running on the device, it just gives those four errors during the build process in Unity.

Incorrect texture dimension!

Hi jwu,

When I build our project to a executable file for Windows platform, the compiler said "Incorrect texture dimensions!".
The calling tree is the followings.


"Incorrect texture dimension!"
UnityEditor.AssetDatabase:LoadAssetAtPath(String, Type)
ex2D_PostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[])

UnityEditor.HostView:OnGUI()

Usually, we build for Android platform with no error.

If you know any clue, I will appreciate.

Thanks

Custom Size works wrong with Use Texture Offset (and scale probably)

http://forum.unity3d.com/threads/101811-ex2D-the-best-2D-sprite-solution-for-Unity-RELEASED?p=903568&viewfull=1#post903568

I encountered a strange bug(?) when using "Custom Size" together with "Use Texture Offset".
Got an animation with 3 frames (each 192x180 pixels) running perfectly in the animation editor. The frames get trimmed in the atlas editor but since I got "Use Texture Offset" they get aligned correctly.

The problem is that I use "Custom Size" with width and heigh at "1" for all my sprites so that unity's physics behaves normally and sprites don't get huge. This way their size at scale (1,1,1) is that of a regular unity primitive. I don't like to adjust the scale of my sprites to strange values like 0.00000123 since that seems to mess up physics.

Now when I try that animation ingame the sprite jumps left and right. If I disable "Use Texture Offset" the jumping is gone, but now, since they were trimmed down in the atlas editor the frames alignment is wrong.

Is there anything I can do to fix this?

Animation Helper - Offset X Y not working properly

I'm trying to animate some gameobject with the animation helper and the offset property and the result is weird.
For example I've done a simple animation on offset Y from 0 to 60 and the object "moves" only to 20 and stops itself.

Images have to be re-imported all the time

I very frequently have to "re-import" images/sprites while using ex2D. For some reason I can't access any "import" settings for many of the sprite/textures and it's unpredictable as to why and when this is happening. However, it is frequent.

Animation Clip Image issue

Trying to create animation clip currently doesn't work. Dragging images into the defined spot ends up in the window not showing any images at all. Secondly, when trying to move the window the window itself is wobbling all over the place (hard to explain).

See image: http://cl.ly/030L182k472u2A0O2S44

Selecting a gameObject with a sprite/animation in the hierarchy navigator fixes broken animations

I have a project where the player character's animations break when a new scene loads. I can't tell if I'm doing something wrong or if it's a bug; I haven't been able to track down the cause.

What is a sign of a bug, however, is that merely selecting the game object in the navigator after this occurs fixes the animations. This is consistently repeatable. Don't even need to touch anything in the inspector; bringing it up is all that's required.

Add Anchor(StartFrom) property in exScreenPosition

The Anchor(StartFrom) could reuse the exPlane.Anchor value except the Middle. This can help user don't worry about the screen position.

Why exViewportPosition don't have this property?

Because exViewportPosition is use relative size [0-1] and no need to worry about the width and height

Black lines around the sprite

Could be avoided if no pixel was touching the edge of the UV square but ex2D seems to be trimming transparency. Add an option for padding inside the uv square?

exViewportPosition & exScreenPosition not working with perspective camera

When using a perspective camera, bot the exViewportPosition and exScreenPosition components do not work as expected.
Having a perspective camera would allow to mix 2D and 3D assets easily, without the need of having multiple cameras.

I used the demo_simple_sprite_anim
Changed Camera projection setting to Perspective
Set Transform2D property to Viewport
Checked Use Pixel Perfect (set to true)
Played with the exViewportPosition component
Changed the z position.

Expected:
Sprite is displayed at same position (as in orthographic projection)

Maybe my expectation is incorrect.

Using version 1.2.1 (evaluation), have tested as well as with the current master branch, compiled on Windows

Bug - exGUIBorder is ignoring white-space in Atlas Texture

I've created a exGUIBoarder object, using a texture which is in an Atlas. The exGUIBoarder editor is removing the white space at the top and left of the gfx. It should be keeping that space.

My use-case is: 2 textures, and UP and DOWN state for a button. The DOWN state gfx has 5 pixels of empty (alpha 0) on the left and top. This is so that when i swap gfx, the button "moves" down-left 5 pixels.

The exGUIBoarder object/editor is removing that alpha'd blank space. This is different behaviour from exSprite objects which retain that data.

The temp fix is to add a slightly non-alpha 0 pixel to the top-left corner to force it to keep that "blank" space.

exSpriteFontEditor generates an error if object containing it is selected in the Hierarchy window during text update

Screenshot:
http://i.imgur.com/3ohT4.png

How to reproduce:

  1. Have a object containing a exSpriteFont component selected in the Hierarchy while running game.
  2. Have a script update the exSpriteFont text property while keeping the object selected, it will create a Array index out of range error.

Note that NOT having the object selected at the time of update will not create the error.

Other possible clues and factors (from my environment that generates this error)

  • exSpriteFont is set to Multi-Line
  • I'm filling it with a string of at least 225 characters
  • This is likely irrelevant, but TimeScale was set to 0 (this was for a pause menu)

Set a camera after instantiating ex2d Sprite Animation prefab.

Hi,

I'm trying to set a camera after instantiating an exSpriteAnimation(ex2D) prefab.
In the prefab, the camera set none. In the inspector window, it said "Prefab only" with red color at the camera box at ExSprite component.

I want to use it as clone instantiated from the prefab.
When I tried to set a camera from the script, the compiler said " Property UnityEngine.Component.camera is read only" as error.

I need to set a specified camera.
How can I solve it?

Crash bug that can prevent opening a project

Description:
ex2d will often crash Unity during it's import asset process.

Frequency:
Once this starts to happen it will always happen.

Steps to reproduce:
In a iOS project that has many texture atlases, transfer the project to another machine. During the asset update process EX2D will crash Unity. This will also happen when converting a regular desktop project into an iOS one as Unity converts all the textures to PVRTC automatically.

Sprite Animation list updates too agressively

The list of Animations on the Ex Sprite Animations component reads its size value too aggressively. This results in losing the set animations when trying to change the size of the array.

Example:
Make a Sprite Animation with 10 Animations. Fill in all the animations. Then change your mind and make it 11 frames: Click in the 'size' field, hit backspace, and type 11. All the animation entries are obliterated, then come back as "none".

The appropriate behavior would be to not actually resize the array until Enter is hit, or the field loses focus. (This is the way the default Array GUI element in Unity works.)

Feature Request - User definable Location for dbPath

In the classes exAtlasDB and exSpriteAnimationDB the dbPath path is set to generate store and load from files in Assets/.ex2D_AtlasDB.asset and Assets/.ex2D_SpriteAnimationDB.asset

This clutters the top level Assets directory and the Project window. Could you please enable the ability to store these in a user definable location whether through some sort of settings in the ex2d menu or by some other method to allow us to override the values in the code. Since the editor code is inaccessible changing the runtime code is pointless if the editor doesn't match.

ExPlane calls Garbege Collection?

Hi jwu,

I found GC.Collect() was called from exPlan.LateUpdate() when I checked the profiler.
I'm sorry that I did not check the sources, but if ex2D actually calls GC.Collect, could you think to give us a option to disable it?

Thanks,

import package failed.

using Unity version is 3.4.2f3.

ex2D.package is double click and install.
then error "NullReferenceException" in Console.

[Pull Request] scale issue

Internal scale and External Scale.
I need scale sprite to .5f and after to 1, on animation per example.

NullReferenceException on exSpriteAnimation.AddAnimation()

I'm running into an issue repeatedly where I'm seeing NullReferenceExceptions when I call AddAnimation() on my animation objects.

The curious thing is, this only happens after I quit Unity โ€“ my project is under source control. If I do a clean checkout, everything works fine. Without changing anything, if I quit and then relaunch Unity, I'll see this error repeatedly. If I do another clean checkout, it works again. Or if I reimport the sprite atlas and a bunch of other things, rebuild some of the atlases (I haven't been able to narrow down exactly where the issue is), it'll work. But next time I launch, errors.

It looks like it's happening on this:

    if ( animations.IndexOf(_animClip) != -1 ) {
        return nameToState[_animClip.name];
    }

โ€“ nameToState is null.

tiny bug in exSpriteAnimation.AddAnimation()

After I append clips like below
[code]
foreach (exSpriteAnimClip c in exClips)
{
sp.spanim.AddAnimation(c);
}
[/code]
animation doesn't show up in running mode,except I open Inspector of that gameObject,and open exSpriteAnimation component node,the animation appeared.

so I try to add this code after add all animations:
[code]
print(sp.spanim.animations.Count + ":" + sp.spanim.animation);
[/code]
then all of them worked correctly.

Internal compiler error

Hi,

when I import ex2D into new Unity 4.0.0f5 I get Internal compiler error. Do you have any workaround?

Thank you, Marek.

text update issue for exSpriteFont after camera switch

here is scenario:

  1. Load initial scene1 with camera1
  2. Load additive scene2 (with exSpriteFont) with camera2
  3. remove all scene1 objects (including old camera)

after that exSpriteFont show text that was set by default in editor (is not update with text from code). But please note that text variable in Inspector still show correct text, just show wrong result in game view. Here is print screen if you need that: https://dl.dropbox.com/u/602071/140.jpg

A font effect asset and effect editor

Put the font gradient color, outline, shadow settings to the FontEffect asset, and use FontEffect editor control the things. The idea is inspired by the post here: http://forum.unity3d.com/threads/101811-ex2D-the-best-2D-sprite-solution-for-Unity-RELEASED?p=684824&viewfull=1#post684824

It would be nice if exSpriteFont accept sharedEffect and effect properties. In this way, we can change effect in the runtime and don't worry about affect other fonts use the same effect.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.