Posts

Post not yet marked as solved
2 Replies
962 Views
We want to use the gamepad's direction pad directions SF Symbols on our game UI and make it change according to user's remapping settings. Something like "Press [DPAD-RIGHT] to open the menu" Although there are SF Symbols for direction pad directions ("dpad.down.fill", "dpad.up.fill", "dpad.left.fill" and "dpad.right.fill"), apparently there's no controller button name constant for these buttons. According to the documentation, there's only GCInputDirectionPad. If no remapping was done, I assume that the GCInputDirectionPad's correspondent sfSymbolName is "dpad" and I can append the direction to that name in order to get the correct SF Symbol from the system.. However, if the user remaps the dpad to some analog, for example the left one, the sfSymbolName for GCInputDirectionPad will probably be "l.joystick" and there's no SF Symbol that can match the joystick right direction. Is there any button name constant for a specific dpad direction, like dpad right, that we could use and avoid appending strings? Also, how can we show a analog direction using symbols, supposing the dpad was remapped to a analog stick?
Posted Last updated
.
Post not yet marked as solved
3 Replies
1.8k Views
We are developing a game on UnrealEngine4 and we need the PNG representation of a SF Symbol to display it on our UI. After watching WWDC sessions and reading the documentation, we achieved it by calling: NSImage* nsImage = [NSImage imageWithSystemSymbolName:symbolNameString accessibilityDescription:nil]; NSImageSymbolConfiguration* config = [NSImageSymbolConfiguration configurationWithPointSize:100 weight:NSFontWeightBlack scale:NSImageSymbolScaleLarge]; NSImage* nsImageWithConfig = [nsImage imageWithSymbolConfiguration:config]; NSData* tiff = [nsImageWithConfig TIFFRepresentation]; NSBitmapImageRep* raw_img = [NSBitmapImageRep imageRepWithData:tiff]; NSDictionary* dict = [NSDictionary dictionary]; NSData* nsData = [raw_img representationUsingType:NSBitmapImageFileTypePNG properties:dict]; However, it outputs an image of 18x14 pixels. We need an image of size 64x64 pixels. How can we resize it before getting the PNG representation so it can be displayed larger on the screen?
Posted Last updated
.