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 - happy123

Pages: [1]
1
Support / Re: How does ortho translate to perspective?
« on: March 02, 2014, 03:58:15 am »
Sounds like an idea!

2
Support / How does ortho translate to perspective?
« on: March 01, 2014, 08:02:32 am »
How does ortho view translate to perspective view? 

I want to use ortho view in the main menu screen on mobile, but then switch to perspective view when I am in the game so I can create 3d shapes.  I am curious how to do so.  I now have the settings so that both ortho camera and perspective camera are showing the objects the same size (see attachments).  This was set through playing around with the settings, but I want to know if there is a specific calculation used so I can set it in the script.

Another question is if I am in perspective view, how can I determine that the object has reach the edge of the screen?

3
Support / Re: How do you do contining raycast?
« on: November 03, 2013, 04:40:09 am »
Okay, I think I got it.  The function I was looking for is in UIManager.cs => RaycastForUIItem().

4
Support / How do you do contining raycast?
« on: November 02, 2013, 06:01:12 pm »
I have a grid of 9 x 9 UIItems that I want to select bad on my input position (both mouse and touch) such as:

1. When I pressed down on the first UIItem, it records that item
2. Without releasing my finger or mouse, I move until I am above another UIItem
3. Once I relase my finger or mouse, the selection is over

I want to know exactly how to do so.  I am reading Hover, but its confusing.  Specifically this part: Hover needs to be enabled to work (Hover actived(tk2dUIManager.areHoverEventsTracked), using a mouse and mult-touch is disabled.  While you have a property IsOver that tracks if a mouse is over the UIItem. 

Here are what I think needs to happen:
* IsHoverEventsEnabled needs to be check for each UIItem
* AreHoverEventsTracked needs to be check in UIManager
* Does not work with mouse, only with touch (?)

The final product will be for mobile, but I need to test with a mouse on the editor. Can you shed some light?

5
Support / Can you play animation with sliced sprite?
« on: October 07, 2013, 04:22:27 am »
Just a quick question.  Can you play animation with sliced sprite?  I am asking because the sprite anchor can be adjusted in runtime for to match the camera anchor, which is quite convenient.  Instead of creating a new sprite in sprite collection with a different anchor.

6
Support / Re: Right size for images
« on: August 12, 2013, 01:15:33 pm »
Hi, it was set to Iphone 5 Tall 9:16.  It seems if I set it to Iphone4 tall, it picks up since there are specified pixels.  However, I am still confused on how to find the right image size for tk2dCamera.. 

For example, now the Native Resolution is 960 x 640 with Preview Resolution of 640x960.  In photoshop, I created a test background with a solid color of size 640x960.  The image resolution is set at 300 pixels per cm.  On the tk2dCamara, the resolution per meter is 1.  It seems like as I set the image resolution higher, the image is smaller when I add it to the game using sprite collection. 

Update: I set the camera and sprite collection to 1 pixel per meter with images scale at Vector3.one.  The preview window looks correct, but when I press the play button, the images are zoomed in (i.e. the become a lot bigger). 

Solved.  Screen scales have to be Vector3.one also...

7
Support / Re: Right size for images
« on: August 12, 2013, 09:48:55 am »
I am actually on 2.1.   I upgrade from 2.0 just last week.  When I uncheck force resolution, it seems I have to change the preview window selection at least once for it to detect, but when I press play, it automatically goes into force resolution.. Sometime previews at 480x320, sometimes at 320x480.  My preview resolution is 960x640. 


8
Support / Right size for images
« on: August 10, 2013, 10:07:02 am »
I am a bit confused on how to set the right image size to import into sprite collection.  I am trying to test with Iphone5  with dimensions 640 x 1136 tall in the editor.  When I got to photoshop and create a png background image 640 x 1136 and import it to the collection, it says the image is too big for the atlas. 

I have tried shrinking the image size to a much smaller size as well.  When I enter play mode in the editor, the image is larger than the preset Iphone5 screen.  I have force resolution preset on the tk2dcamera.  Is there any resources that can give me a good overview how to properly incorporate images with 2dtoolkit for multiple mobile dimensions?

9
Support / Re: Inconsistent firing for UIItem
« on: July 22, 2013, 02:00:19 pm »
I need to look into it.  Right now my screen at stacked on top of each other and I .setActive(false) to screen I don't use.  That might be causing the problem.  On the level picking screen there's only: 1) the background --> 2) the page container --> 3) the level buttons.  I will post an update once I figure it out.

10
Support / Re: Inconsistent firing for UIItem
« on: July 22, 2013, 01:34:03 pm »
Hi,

Its the same.  I tried using UIItem for tiles on my game board as well and they aren't responding either.

Update:
I found the problem.  Its the Raycast Layer Mask in the UI Manager.  Instead setting it to "Everything",  I need to specify layers to raycast to.  Otherwise, it doesn't always respond.

11
Support / Re: Inconsistent firing for UIItem
« on: July 22, 2013, 12:32:47 pm »
Hi,

I am not seeing any difference. 

- Lap

12
Support / Inconsistent firing for UIItem
« on: July 22, 2013, 09:29:58 am »
I am having trouble with UIItem and am wondering where the problem originates.   I have a screen with multiple objects that are the same.  They are buttons that allow users to select a level to play.  I found that some of these buttons doesn't respond to being clicked or when clicked fires multiple times.  Below is the script attached to the game object. 

The other components I have attached are tk2dSprite, tk2dButton, tk2dUIItem, and Pool Object (prefactory - > http://www.booncotter.com/unity-prefactory-a-better-pool-manager/).  I am using the tk2dUIManager and tk2dCamera as well.

Is there any reason why this is happening?


using UnityEngine;
using System.Collections;

public class PageItem : MonoBehaviour {
   public GameObject system;
   public tk2dUIItem button;
   int level, index;
   
   void Awake()
   {
      string[] nameArray = name.Split(' ');
      level = int.Parse(nameArray[1]);
      index = int.Parse(nameArray[3]);
   
      system = transform.root.gameObject;
            
      renderer.enabled = true;
   }
   
   void Start()
   {   
      setTransform();   
   }
   
   private void setTransform()
   {
      float posX = 1f / ((float)PageInfo.itemsPerRow + 1), posY = 1f/ ((float)PageInfo.itemsPerColumn + 1);
      
      int row = Mathf.CeilToInt((index + 1)/ (float)PageInfo.itemsPerRow);
      int column = index + 1 - ((row - 1) * PageInfo.itemsPerRow);
      
      transform.localPosition = new Vector3((column * posX) - 0.5f, 0.5f - (row * posY), -1f);   
      transform.localScale = Vector3.one;
   }
   
   // 2Dtoolkit
   void OnEnable()
   {
      button.OnClick += pickTeam;
   }
   
   private void pickTeam()
   {
      system.SendMessage("pickTeam", level);
   }
}

Pages: [1]