How do I create a test bulb? - philips-hue

I am trying to test an app I am working on and I want to see how it works with multiple and different bulbs, but I don't have as many lights as I would like.
Is there any way to create a "fake" bulb that acts like a normal hue bulb and works with the hue app? Basically, I want to trick Hue into believing that there are a few more lights connected to the bridge.

If you just want to test the UI with more lights than you have, why not just create your own PHLight objects? This will not let you interact with them ofcourse, but you can test certain UI elements (test a listview with more lights for example)

Related

How to get rid of webkit Gamepad API deadzone?

I'm using gamepad api1 to read controller axis value in a web based game, but found that the gamepad API always applies a certain amount of "deadzone" around the center of each axis, where the value doesn't change even when the gimbal on the controller moves. I understand this is useful for common home use controllers, but this is really undesirable for precision focus controllers. How do you disable this auto applied deadzone in webkit?

Revit Addins that Run in the Background/Always

Is there a way to create a Revit macro/add-in that will be running constantly. My employer is curious if I can write a program that makes a piece of equipment (for example a lighting fixture) a different color if it is not circuited/not connected to a circuit.
Let me know if there is a way or if there is a completely different method I could use to achieve this task.
Be straight with me, because I am willing to make an add-in that you still have to run every time to check the parts for circuitry. But obviously, the background running add-in would be nicer... Thanks!
Possible a couple different ways.
Best way is probably Updaters.
Fall back would be Idling/External Events.
But generally if you want to update something dynamically based on when things change, Updaters are the way to go. I believe that there are samples in the SDK.
There is a much simpler way to do this. You can use a filter in your view to change the color, or other properties, if the element isn't circuited.
In Visibility Graphics, Filter Tab, Create a new filter, for category select Light Fixtures, for the filter criteria, select Circuit Number, for the comparison, choose Less Than, use the value .
This will match fixtures that haven't been powered & fixtures that have been powered but not assigned to a panel.

Fixed user interface elements for cardboard

I want create fixed user interface elements like "time remaining until the end of the level".
time remaining element
How should I make it to show it correctly in stereo camera
What you want is called non-diegetic UI and is a bit of an antipattern. The recommended way of doing this is to do a diegetic UI - something that is positioned somewhere in the scene, preferably on something that would make sense in real life - for example a computer screen on a console that is in sight.
Still, if you want something in a forced location, it will work well. To do this you should render it in 3d and rotate/position it so that it's always in front of your camera. For example if you would be using the Unity game engine, you could create this UI element as a world space canvas and parent it to the main camera.

Unreal Development Kit Portals/Teleporters

I'm trying to use UTTeleporterCustomMeshes in UDK in a way that is similar to the behavior in the game Portal (the actual portal itself, not the portal gun).
That is:
You can shoot through them as well as walk through them (DONE)
It appears as if you can see through the portal as if it were a window (DONE)
You can stand half way through a portal and be at both sides simultaneously
Shadows and light will also carry through the teleporter
My problem is that I can't seem to find any detailed documentation for UTTeleporters.
Do the teleporters have some built in functionality for this kind of stuff or do I need to implement it all myself?
Ie, create a custom camera to capture the scene to be rendered onto my teleporter and create my own custom teleporter script?
I'm just after SOME sort of direction or ideas ast to how I could achieve this.
Cheers
EDIT:
I've since managed to get steps 1 and 2 working (UTPortal did the trick), though 3 and 4 still remain a challenge.
My first mistake was trying to use UTTeleporterCustomMeshes.
No matter where I went through, it would always spit me out at the middle of the target teleporter. Plus I'd have to do something like #Sebastian said with the TextureRenderTarget.
I still have a long way to go before it starts to look seamless!!
Then, onto stage 2!
Unreal does as far as I know does not support that type of behavior.
You can however build it yourself.
I would look at the TextureRenderTarget classes for rendering the material on the portal.
Standing in the portal with one foot on each "side" will be... very tricky to do but shooting and walking through them should be simple enough by extending the touch event in actor.

When to use CCScene vs CCLayer?

I'm kind of a UI buff - every "screen" in my game should transition in/out when it appears or disappears. Because my game is simple in terms of resources, I thought I'd just make each "screen" a CCLayer and define a function for the transitions, leaving everything in memory. It's turning out to be more complicated than I expected.
I think I have two main problems right now:
1) Each "screen" is a CCLayer. This looks fine, but I can't seem to stop receiving touch events, even when they are inactive. Child sprites do not seem to respect the isTouchEnabled property, so I'm hitting invisible buttons all the time.
2) I wrote a custom button class that is basically a sprite with a few separate textures for states. It uses the CCTargetedTouchDelegate protocol. I'm thinking this is a big part of the above problem.
I'm not quite clear on the CCMenu stuff. Is there a tutorial or documentation out there that better explains its designed purpose and how to use it? The documentation for cocos2d doesn't talk at all about what each class does, which makes it much, much harder to properly use the library. Also, when should I use a scene instead of layers? Can I write custom transitions?
I found that if you have multiple layers in a single scene for menus, such as for a main menu (simpler to have a layer for load game, new game, etc. than an entire scene) that if you add all of you buttons as children of the layer; then to stop them from receiving touches, simply move the layer off screen when not in use. Heres an example.
[loadLayer setPosition:CGPointMake(-1000,-1000)];
[settingsLayer setPosition:CGPointMake(-1000,-1000)];
[menuLayer setPosition:CGPointMake(0,0)];
And each time you select a button that would take you to say the load game layer just reverse it for the right layer.
[loadLayer setPosition:CGPointMake(0,0)];
[settingsLayer setPosition:CGPointMake(-1000,-1000)];
[menuLayer setPosition:CGPointMake(-1000,-1000)];
It's more convenient to use CCScenes for menus. All of the children of an inactive CCScene will not receive touch events, so you don't have to manage that behavior. CCScenes also have built-in transitions like a crossfade, but if you're like me, you'll probably just want to run an action to make the scene transition out, then call CCDirector:replaceScene.

Resources