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

Pages: [1]
1
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?

2
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?

3
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.

4
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?

5
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]