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.


Messages - BraveSirRobin

Pages: [1]
1
Support / Re: Accents in a tk2dTextMesh
« on: May 08, 2013, 10:43:23 pm »
Quote
Are those characters in the font? They should work if they are in the font.

Oops...  :-[

2
Support / Accents in a tk2dTextMesh
« on: May 08, 2013, 09:34:14 pm »
Quick question:

Can I use accents in a Text Mesh? Whenever I try to use a letter with an accent (E.G.: ñ) the character does not appear.

Thanks in advance.

3
sprite.color is a property.
You will need to do this:

Code: [Select]
Color c = myTk2dsSprite.color;
c.a = 1.0f;
myTk2dsSprite.color = c;

I tried changing the alpha of a tk2dsprite in an animation, changing the Color.a form 1.0 to 0.0 in the tk2dsprite but the sprite is still showing.

The shader I am using is tk2d/BlendVertexColor

Any suggestions?

4
Support / Re: Issues with Gameobject's position and Input.mouseposition
« on: January 07, 2013, 02:51:06 am »
The issue is that Input.mousePosition isn't getting scaled and offset for the camera when overrides are applied.

The easiest way to handle this is to use Camera.ScreenToWorldPoint to convert the screen space point from Input.mousePosition to world space. You can then simply use the value directly. You will get the values rescaled to the native resolution.

Actually Input.mousePosition was being scaled (As I've mentioned originally Top right on the iPad reads x: 768.0 and y: 1024.0, on the iPhone it reads x: 480.0 y: 320.0))

Also, are you sure it's ScreenToWorld?

Because I've used ScreenToWorld at first, and I got weird results (like Y coordinate in the thousands in the iPhone wide).

When I've switched to WorldToScreen and it started working (at least on iPad wide and iPhone wide, haven't tested it in the other platforms, but I don't see why it wouldn't...).

I'll check the button sample anyway.

One other question: My box colliders (which I am using to lock the position) are scaled to X = 60 and Y = 60 in the iPad version, but they still keep this scale in the iPhone version, is there any way I can automatically rescale my box colliders as well, even though it does not have (at least not for now) any tk2d component?

Thanks again!

5
Support / Issues with Gameobject's position and Input.mouseposition
« on: January 06, 2013, 07:38:20 pm »
Hi,

I am using a tk2dCamera with a native resolution of 768x1024 (iPad Wide), and I've also created a 480x320 override (iPhone wide).

I have several draggable tk2dsprites, and what I want to do is:

- When I click and hold on a sprite I want to drag them around the screen
     - This is working fine

- When my Input.mousePosition lands inside some given predefined boxes I want to lock the tk2dsprite within the box
     - Input.mousePosition information is also fine on different screen resolutions (i.e.: Top right on the iPad reads x: 768.0 and y: 1024.0, on the iPhone it reads x: 480.0 y: 320.0).
     - I've defined the boxes as empty gameObjects with box colliders, only to have a reference on the size of the lock boxes compared with my background sprite, I didn't intended to use them to check collision

And this is where my problems begin...

If I check the position of the box colliders when running on iPad wide everything's fine. As reference, one of the boxes' transform.position read (106.0, 655.0, 500.0f). Placing it on the top left corner of my screen. And the game works as expected, drag and drop the sprites on the boxes work like a charm.

However, when I switch the platform to iPhone, the sprites rescale correctly, but the same box reads the same transform.position of (106.0, 655.0, 500.0), effectively putting it OUTSIDE of the screen (since the iPhones' height is 480).

I hope the description is clear enough... What am I doing here?

Thanks in advance

6
Support / Sprites not aligning with the tk2dcamera?
« on: December 03, 2012, 09:03:15 pm »
Hey everyone.

I am new to 2DTK, and have some experience with Unity.

So I've just created a tk2dcamera, and configured the resolution override to 1024x768 and a wildcard override.

http://imgur.com/CgRMg

Next I've created an anchor in the Upper Center with no Offset

http://imgur.com/6DRKr

And inside the anchor I've created a sprite.

http://imgur.com/SFp4N

In the Game window the screen is doing exactly what is supposed to, regardless of the aspect ratio, which is what I've wanted and why I've set up the overrides

http://imgur.com/bQzqj

However, when I look at the Scene window, the sprite is completely off of the camera, and because of that I am unable to get a tap in the sprites using raycast.

http://imgur.com/lzRvg

So my question is twofold:

1) What am I doing wrong? Why my sprites are appearing off from the camera in the Scene Window? Is this why I am unable to get the raycasts
2) Getting raycasts is the correct way of detecting taps in 2D Toolkit sprites?

Thanks in advance.

Pages: [1]