Space Engineers

Space Engineers

521 oy
TouchScreenAPI
20
8
7
2
4
2
5
4
2
3
2
   
Ödül
Favorilere Ekle
Favorilere Eklendi
Favorilerden Çıkar
Type: Mod
Mod category: Block, Script, Other
Dosya Boyutu
Gönderilme
Güncellenme
835.361 KB
29 Kas 2021 @ 21:33
21 Oca 2024 @ 12:15
22 Değişiklik Notu ( görüntüle )

İndirmek için abone ol
TouchScreenAPI

Adriano tarafından 1 koleksiyonda
Adriano's Space Engineers Mods
6 öğe
Açıklama


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.
Popüler Tartışmalar Tümünü Görüntüle (1)
22
15 Kas 2024 @ 15:02
SABİT: Share your ideas of Touch Apps
Adriano
109 Yorum
SioxerNikita 19 Eyl @ 10:17 
Yeah, I can see how that is annoying for sure
Adriano  [yaratıcı] 19 Eyl @ 4:52 
@SioxerNikita Hey, thanks for the question. That is already kinda implemented.

First, the cursor position and clicks are impossible without this base mod, because these information are not available for in game scripts api. So at least one mod is still needed.

Second, the API is already split like that, just the cursor and clicks in one part, and then the ui elements as optional.

Third, I have working examples of this running on in game scripts on my github repo If you really want it. But I never recommended it because of the way in game scripts work on servers.
Basically every screen update is sent to the server and sync, that would cause a single mouse moving around a lot of data to be sent.

So, unfortunately that is a limitation of the game structure. I tried a few workaround but couldn’t make this work.

Since the base api mod is needed anyway, I would recommend just using a TSS script mod.
SioxerNikita 19 Eyl @ 3:25 
'ey, a real good question.

Can you make this function at a basic level with ingame scripts?

Just basic hooks like mouse position, left/right/middle currently being pressed. Just pressed and similar can be written yourself. The elements would be unnecessary.

Beyond that, this is freaking great.

I know you just said you ain't adding features, but if wouldn't be too much?
Adriano  [yaratıcı] 26 Tem @ 12:51 
@kurama hey, I’m still around but not actively working on anything. I had a few great ideas in progress that you can find if you search for my name on Keen’s Discord modding channel.

A couple of guys reached me to use the API but unfortunately they didn’t finish theirs as well.

At this point I’m mostly waiting for SE2 and just maintaining these ones, with no new features.
kurama 26 Tem @ 10:52 
what happened to this?? has so much potential
EthicalObligation 20 Eki 2024 @ 4:49 
Yeah. This should be front page. There is so much you could do. We need more Apps!
surprisedpoultry 8 Eki 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  [yaratıcı] 8 Eki 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 Eki 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 Tem 2024 @ 5:50 
Awesome, thank you for the answer! I'll be tossing this onto my server then!