exdev / ex2d Goto Github PK
View Code? Open in Web Editor NEWDocumentation, runtime scripts and others of ex2D
Home Page: www.ex-dev.com/ex2d
Documentation, runtime scripts and others of ex2D
Home Page: www.ex-dev.com/ex2d
once the "Gradient Color" checkbox is enabled
will disable the color selection in exSprite and add another component to choose color for each vertex.
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.
The default is Automatic Truecolor
maybe add some other format like Automatic compressed
the animation works great on photoshop but then ex2d rescales it so that the animation stretched in width instead of in height like it was animated to.
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.
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
Screenshot:
http://i.imgur.com/3ohT4.png
How to reproduce:
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)
using Unity version is 3.4.2f3.
ex2D.package is double click and install.
then error "NullReferenceException" in Console.
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
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.
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.
http://i.imgur.com/avhfc.png
Fortunately all I have to do is use the zoom slider to make the texture fit into the atlas window and the controls function again.
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.
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.
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.)
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?
Internal scale and External Scale.
I need scale sprite to .5f and after to 1, on animation per example.
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.
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.
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?
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()
check this image:
https://www.dropbox.com/s/0jwo5qy245qdmlg/viewportissue.png
The soft clip only clip planes that not rotated and sheared. But a shader clip may be better to handle non-regular clipping.
You can see the desired shadow bias in this screenshot I submitted for another bug
http://i.imgur.com/n6uIh.png
Here is the result when you scale the object, the shadow becomes drastically separated
http://i.imgur.com/GWBUy.png
Desired result:
Not having to re-adjust the shadow bias simply because the ex2D scale was adjusted.
Hi,
when I import ex2D into new Unity 4.0.0f5 I get Internal compiler error. Do you have any workaround?
Thank you, Marek.
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.
During the Atlas creation process I can't see the images on the checkerboard (which is also missing). Please see screenshot.
In an effort to reduce draw calls I've been going through my UI text and setting the scale 1 and using ex2D's scale parameters instead, except I have yet to do one properly because I get a bunch of errors in the console whenever I try.
Here's a screenshot.
http://i.imgur.com/n6uIh.png
Using Unity 3.5.5f2
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.
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.
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.
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.
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,
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,
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
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.
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 )
:/
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.
A collision mesh editor to help user edit convex shape collision mesh.
Request source:
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.
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[])
Usually, we build for Android platform with no error.
If you know any clue, I will appreciate.
Thanks
Hi,
Simply it doesn't work.
M.
here is scenario:
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
Same as the title.
I got crash when I sync ex2d DB, unity could not allocate memory, crash using 3.7Gb
my system Win7 system memory 8Gb
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.
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?
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 ()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.