Space Engineers

Space Engineers

508 betyg
TouchScreenAPI
20
8
7
2
4
2
5
4
2
3
2
   
Utmärkelse
Favorit
Favoritmarkerad
Avfavoritmarkerad
Type: Mod
Mod category: Block, Script, Other
Filstorlek
Lades upp
Uppdaterades
835.361 KB
29 nov, 2021 @ 21:33
21 jan, 2024 @ 12:15
22 ändringsnotiser ( visa )

Abonnera för att ladda ner
TouchScreenAPI

I 1 samling av Adriano
Adriano's Space Engineers Mods
6 artiklar
Beskrivning


TouchScreenAPI
This mod adds Touch Screen feature and UI Elements to Space Engineers. It is a framework for other mods and programmable block scripts.

It allows modders to add interaction with in game LCD screens like a mouse cursor or touch screen. By itself this mod adds nothing to the game. See a list of Touch Apps by the end of this description.

If you are a player and liked this mod. Feel free to give your feedback and ideas.
But please remember, this mod has no features with the game blocks besides drawing to screens. Any interaction with blocks are handled by mods using this.

How to use it
If you want to develop a mod or script using this, feel free to send me a message on Github[github.com], Steam or Discord (@adrianolima).
For details about using it, see the project readme files on Github[github.com].

The API is ready for use, but feedback is always welcome. Also, communicate with me if you're using it, if I need to make an important change I can let you know you in advance.

Mouse clicks and Joystick
It now accepts Left click as primary action button, some apps may have separated funcionalities for Right click and Middle click as well.
On joysticks use RB for primary and LB to reproduce right click action. For middle click action press both RB and LB.

Ui Kit - Elements
The Ui Kit is a decent library of common UI elements, there are more elements planned.
It is completely optional, the Touch features can be imported and used separated from the UI elements if the mod only needs the cursor feature.
  • TouchApp - It is the main element, control draw loops, updates and dispose.
  • Button - A simple button with a text label. There is an empty version of it that can have icons as children.
  • Chart - Line charts on a grid, can have multiple lines.
  • Checkbox - Simple checkbox.
  • Label - Text Label, one of the simplest elements.
  • ProgressBar - Progress bar, have a vertical option, also optional label.
  • Selector - Multi options selector.
  • Slider - A slider witha draggable thumb.
  • SliderRange - Another slide, but for a range value, has two thumbs.
  • Switch - A multi options switcher, can be used like tabs for a panel.
  • TextField - Text input field, editable with keyboard. One of the most complex elements.
  • View - The major container, has properties like margin, padding, border, alignmet, etc.
  • ScrollView - Like a view, but with scroll, automatically hide children out of bounds.
  • WindowBar - Useful for app names and buttons for options at the top of a window.
  • EmptyElement - Useful for adding custom MySprites to the App's hierarchy.

Ui Kit - Styling
Every component have some properties to change their visuals, they're inspired and works like html+css elements. May looks pretty straight forward if you're familiar with website development.
The most importants are these, for a complete list and documentation see the project github page:
  • Enabled - If false, the element will not be drawn.
  • Absolute - If true, the element will not align and anchor with the parent.
  • Flex - The ratio of the parent that this element should fill.
  • Pixels - Fixed size in pixels, not related to parent.
  • Margin - Margin value for spacing elements on the four sides.
  • Padding - Padding value for inner spacing of an element on the four sides.
  • Border - Border value for an element. It is colored by BorderColor property.
  • Anchor - Position of the children on the same axis of the Direction. Like start, center, end, etc.
  • Alignment - The aligment of children on the crossed axis of the Direction
  • Direction - The direction the elements will line, like Column and Row. Can be reversed.
  • Gap - Adds a spacing between children. Better than adding margin to each child.
  • BgColor - Background color.

LCD Screens
It automatically works for all current screens in vanilla game and DLCs, including cockpits and both large grid and small grid. But it also works for custom modded LCD blocks with a quick setup using Screen Calibration TSS.
There is also an API for adding and removing screen coordinates with code, see github page for details.

Touch Apps



- "If I have seen further it is by standing on the shoulders of Giants."

Thanks for all the support at Keen's Discord #modding-programming channel, this community is amazing! ❤️ Digi, Malware, enenra, Draygo, Klime, Gwindalmir and many others.
Populära diskussioner Visa alla (1)
22
15 nov, 2024 @ 15:02
KLISTRAD: Share your ideas of Touch Apps
Adriano
104 kommentarer
EthicalObligation 20 okt, 2024 @ 4:49 
Yeah. This should be front page. There is so much you could do. We need more Apps!
surprisedpoultry 8 okt, 2024 @ 12:35 
I recreated a new world with just the electric info app in it and it was working properly. I added my app after and it was also working well. I don't know how I go myself in the state that didn't work but it is working now. *shrug*
Adriano  [skapare] 8 okt, 2024 @ 12:15 
@surprisedpoultry the middle clock was the old way, currently just the left click should do the trick. Are you sure you have the API mod added to your save? It is the one responsible for preventing the default click and calculating the cursor position.
Did you try the electric app or the button pad app in the same save to check the mod is working?
surprisedpoultry 8 okt, 2024 @ 12:09 
I'm looking to make my own app using your API.

I realized quickly through testing that the "Public title" box would start appearing the minute I click anywhere on the LCD screen. The comments in the electric network app mention this and the answer is to use middle mouse button which didn't work for me.

Is there another way for me to disable this behavior?
Lells 25 jul, 2024 @ 5:50 
Awesome, thank you for the answer! I'll be tossing this onto my server then!
Adriano  [skapare] 19 jul, 2024 @ 6:20 
@Lells hey, this is a Mod and needs to be added to the server 👍
This one is a required dependency for both apps in the description.
(The apps are also mods btw, and in theory it is possible to create apps using PB and this API but it is not recommended because of networking)
Lells 19 jul, 2024 @ 6:14 
Scanned through comments, the description here, the GitHub readme, and the Electric Network Info app looking for the answer, but didn't see the answer, Workshop item tags are ambiguous, so I'm just going to ask:

Is the API an actual mod that the server will need to have installed, or is it a script that goes in a programmable block? Same question for the applications.

I would like to incorporate this on my dedicated server, but:
Script - Client side install only
Mod - Server side install
So it's important to know which one I'm dealing with.

Thanks in advance for your time and I hope for a response, this looks amazing and you obviously put in a ton of hard work.
Adriano  [skapare] 19 feb, 2024 @ 3:06 
@zeroGhost hey, unfortunately the TSSs need some server side logic to run, so it is not possible using the plugin loader that just insert mods locally. I tried that when I first release them.
Thanks for the kind words.
zeroGhost 19 feb, 2024 @ 2:09 
hey Adriano, this is genius work your doing here .. i wish SE was bigger community to be more properly appreciated .. at this point servers are not even willing to run mods that really make the game function ..like this one.. i am forced to use SE plugin Loader to sideload mods ...were my question comes from .. is this and its DAPPS possible to be tweaked to work client side in the SE plugin loader
Adriano  [skapare] 18 feb, 2024 @ 14:20 
@Rastlore30 Hey, thanks <3 About disabling subgrids, that is not possible currently but it may be something I can add in the future. Good idea! I added to my notes and will try to include it on next round of updates :steamthumbsup: