Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - nachobeard

Pages: [1]
Support / extractRegion in sprite definition - ok to use?
« on: January 14, 2018, 10:51:58 pm »

my question refers to the following members of tk2dSpriteDefinition:

public bool extractRegion;
public int regionX, regionY, regionW, regionH;

are they safe to use within a non-editor script?
I'm using it to find the size of the sprite at runtime, but there's a comment implying that they may only be intended to use from the editor side and it sounds to me like they could not be filled in when running outside the editor:

/// Speficies if this texture is extracted from a larger texture source, for instance an atlas. This is used in the inspector.

that's all

many thanks

Support / sprite shimmering after upgrading from unity 4.7 to unity 2017
« on: September 05, 2017, 11:48:59 pm »

I just spent a little while upgrading my project from unity 4.7 (using 2dtk 2.5.6) to unity 5 (using 2dtk

so far the transition is going fine except that I get this weird shimmering pixels on sprites.

I've attached two GIFs where you can see what I mean.  in both GIFs the camera is locked to the main character, and the main character is moving vertically (shimering2.gif is just a zoomed-in version of the first).  It seems that having the camera locked to the main character and then having the main character move vertically makes it more noticeable.

the sprite doesn't have any weird scaling or anything like that.  it was literally working 100% ok in 2.5.6

any suggestions as to what might be causing this?



I've been adding rigidbodies to all my moving sprites that have a collider component, so as to avoid the performance warnings that pop up in the profiler when colliders move around without a rigidbody.

However after adding the rigidbody components I'm getting a ton of warnings like this in the console:
Code: [Select]
Supplied NxActorDesc is not valid. createActor returns NULL.

more specifically, whenever I deactivate the gameobject I'll see the warning in the console.
this happens with all 300+ sprites used for enemies etc in the level so it gets kind of nasty.
I'm concerned about the meaning of the message as well as any impact on performance.

I've looked around with google and the message seems related to phys-x but not much else.
I realize this isn't an issue to do with 2d toolkit itself necessarily but as a user of 2d toolkit any help is appreciated.

I'm on unity 4.7 if that helps.


Support / tile sprite uvs in shader
« on: January 14, 2016, 01:11:26 am »

I'm working on a small shader effect for a tiled sprite where I wobble the v coordinate to simulate rippling water.
I just added this to wobble the v-coordinate:

Code: [Select]
i.texcoord.y += sin(i.worldpos.y + _Time.z) * 0.009f;(worldpos is the world position of the pixel we're rendering)

the problem is that when I push the v coordinate beyond the edge of the sprite in the sprite collection it reads whatever happens to be next to it.
the desired behaviour here would be to tile the v coordinate so if it goes off the top edge of the sprite in the sprite collection it'll warp back to the bottom instead of reading outside the sprite.
note that this is a tiled sprite with a sprite animator.

I've attached a wobblyWater.GIF where you can see what it actually looks like.  at the bottom the v coordinate goes outside the sprite in the sprite collection so I get empty space and some garbage.  if the v coordinate would loop back at the top it'd look perfect.
noWobble.GIF is the same thing without wobbling.

what would be the best way to tile the v coordinate so it always stays within the currently visible frame of the sprite?

my suspicion is, if I get the current frame's bounds within the spritesheet I can probably do the tiling in the shader.
but I don't know how to get the current frame's bounds.


Support / tilemap tearing even with large amount of padding
« on: June 20, 2015, 01:10:37 am »

I've been noticing that there's some occasional "gaps" in the geometry of the tilemaps where some of the background becomes visible.  it's quite a jarring effect.

I've looked through the forums and you suggest adding padding to the spritesheet, which I've already done but the tearing is still there.

Please take a look at the attached images, where you'll find:
-an ingame image with the tearing
-a screen capture of the editor, showing the tilemap geometry
-a screen capture of the tile collection settings
-a screen capture of the spritesheet settings
-a screen capture of the sprite settings

You'll notice that there's plenty of padding, yet the tearing is still evident.

I'm using unity 4.6.6f2 and 2dtk 2.5.3

I've been happily using 2d toolkit for two years except for this tearing effect, which is driving me nuts.
It tends to happen when the camera is moving very slowly, which makes it all the worse because everything is moving smoothly and you notice these sudden flickers.


Pages: [1]