I'm learning about view controllers and skscenes for a spritekit game and have a button in the view controller for an in app purchase. I put it here and not programmatically in the skscene because I can drag and create outlets and actions that made the IAP setup easier. However I need to disable this button during the skscene controlling the game to it isn't accidentally tapped. I can post code if need be but it's basically just a UIbutton outlet that I want to be able to edit another scene file, it should be enabled in the game over scene but disabled in the game scene.
In general its not a good idea to use UIKit elements in SpriteKit games.
You should create all your buttons using SKSpriteNodes directly in the scene rather than using UIButtons in your game view controller. There is plenty tutorials to google on how to create buttons in SpriteKit.
Its a common thing people do
How to fix the share button on SpriteKit Swift when Players plays the game again Share Button shows up on the game scene?
If you still want to use UIButton than I believe this is what you are looking for
someUIButton.isUserInteractionEnabled = false
Just call it at the correct spot
Hope this helps
Related
Is it possible to implement a draggable view with Xamarin View? Is there basically an event that I can use that gets triggered when a finger is pressed on the screen, then moved and then released without having to use native Android/iOS code? I don't mean a swipe event, I know this exists. I am looking for a event so I can let the user be able to drag a rectangle across the screen for example.
Looked for it on the internet, but can only seem to find just normal Touch, Swipe and Tap events. (Although I found it is possible using native Android/IOS code.
I want to handle table view didSelectAtRow delegate method in Siri Shortcuts Custom IntentUI.
Also I wan to handle UIButton Action in Siri Shortcuts Custom IntentUI.
Is any of the case possible?
Please share some solution (if possible)
#SiriShortcuts
#iOS12
#Custom IntentUI
You can't handle interactions in a Custom Intent UI as the intent controller does not receive touch interactions. This is from the official documentation -> Check the section requirements and limitations.
You can update your view controllers as needed using timers or other programmatic means. Your view controllers also receive the normal callbacks when they are loaded, shown, and hidden. However, your view controllers do not receive touch events or any other events while they are onscreen, and you cannot add gesture recognizers to them. Therefore, never create an interface with controls or views that require user interactions.
I have a requirement to build multiple scenes in web VR A-frame. Each scene will have a button which when clicked, will load a new scene with different background.
What is the recommended way to build scenes in A-frame?
Create just one scene and swap the entities at runtime. Each entity can correspond to a button, background, etc.
Create multiple pages(eg. index.html), each having its own scene and load each page on click event.
Approach (1) seems to be the preferred one as the second approach would mean that 'Back' button in browser will be enabled on loading new pages, which is undesirable and affects the user experience in VR.
Can anyone confirm that approach (1) is preferred?
Definitely a better experience if you can keep everything in a "single-page app" (1) and swap out entities. Especially if you are doing something as simple as swapping a background. Only a couple browsers have implemented proper in-VR link traversal, and the link traversal UX at the moment is non-existent.
https://aframe.io/docs/0.6.0/guides/building-a-360-image-gallery.html
So I'm working through the code in this tutorial which has a small button labeled 'Touch Me'. When you tap this it brings up a new view which also has a close button. I've added a screenshot below and you can download the source code here.
The problem I'm having is that I can't seem to port over this .xib code to work in Xcode 4.2 storyboards. I am trying to keep that same 'Touch' button and 'AnotherView' displaying on a brand new 'Master-Detail Application' running iOS 5.
I am struggling to even keep the button displaying on every view. As in, you can tap the button 'Touch Me' to bring up this alternate view at any page - in the table view or the detail view. I hope this makes some sense? Note that I'm NOT talking about the table row, just the top right button in the UINavigationBar.
Please let me know if I can provide any more details! Just trying to build a similar functionality as the 'Touch Me' button in a fresh new iOS 5/Xcode 4.2 Storyboard app WITHOUT any .xib files. thanks in advance
As your know storyboard doesn't use XIBs so you won't be able to follow the tutorial line for line.
I recommended first creating a new storyboard project and select the "Master-Detail Application" template when creating the project. This will create a project with a Navigation controller. You can then follow the tutorial on customizing the navigation bar. When following the first part of the tutorial, you will need to select the initial view,"Navigation Controller", in storyboard and change its class to "KTNavigationBar" after you create that class.
Currently getting started on a new wpf project and want to use mvvmlight. My initial thought was to have 4 buttons as navigation at top of the window and then a contentcontrol where new views would be injected when chosen from the navigationbuttions.
That is a mainwindow and som subviews that will be injected. The main VM should have commands hooked to wired up with the navigation buttons. When executed the command should send a navigation message to change a view, and this is where I get confused. Who should handle the navigation messages send and change the view in the ContentControl? I guess the ViewModelLocator is only for instantiating the viewmodels.
What is missing in getting this glued together?
Best regards
See this answer for a dialog strategy. This should be applicable to your problem. However, one word of caution when using messages in the above szenario ... call Unregistr() especially on your views.