how do we display an image/color in lua - lua

I am having this problem, and I am not able to figure out the solution.
I wish to display an image in some window if possible(not necessary tough), and then move it across the page by sending events from keyboard.
The problem is I can't use LÖVE framework, as we can't integrate it into our setup.
So I would require the Lua api's to do so.
Is anyone here aware about it? Also do I have to install some kind of extra library to support color and image operations?
Thanks for sharing the knowledge.

Lua is quite a bare-bones language to start with, so there is no built in image support whatsoever. But this also goes for almost all other programing languages, image support is typically something contained in supplementary libraries.
You need to install some library providing GUI functionality (like IUP), or use an application integrating Lua with graphical libraries (like murgaLua, Löve, ...)
From the tags you attached to your question it seems that you're using an embedded platform. It might be useful for people to know which, in order to provide more useful answers.

Related

Embed Unreal Engine 4 project into another app

I've been trying to work on a proof of concept (POC) where I can embed a UE4 project into an existing application (in my case NativeScript) but this could just as easily apply to Kotlin or ReactNative.
In the proof of concept I've been able to run the projects on my iPhone launching from UE4 pretty easily by following the Blueprint and C++ tutorials for the FPS. However the next stage of my POC requires that I embed the FPS into an existing NativeScript application, this application will manage the root menu, chat, and store aspects of the platform in the POC.
The struggle I'm running into is that I cannot find how to interact with the xcode project generated from the blueprint tutorial and the C++ tutorial generates a xcode project that i'm unsure where the actual root is that I need to wrap.
Has anyone seen a project doing this before and if so are there any blogs or guidance that you can point me to? I've been Googling and looking around for a couple weeks and have hit a dead end. I found a feedback post here from April of 2020, that was referring to a post in January 2020 that talked about how Unity has a way to embed into other applications additionally a question from 2014 here. But other than that it's a dead end.
A slightly different approach
Disclaimer: I'm not an UE4 developer. Guilty as charged for seeing an unanswered bounty too big to ignore. So I started thinking and looking - and I've found something that could be bent to your needs. Enters pixelstreaming.
Pixelstreaming is a beta feature that is primarily designed to allow for embedding the game into a browser. This opens a two way communication between a server where the GPU heavy computations happen and a browser where the player can interact with the content - the mouseclick & other events are sent back to the server. Apparently it allows some additional neat stuff, however that is not relevant for the question at hand.
Since you want to embedd the Unreal application into your NativeScript tool(menu of some kind if I understood correctly), you could make your application a from two separate parts:
One part would run the server.
The second part would handle the overlay via the pixelstreaming.
This reduces the issue of embedding the UE4 into an application to the(possibly easier) issue of embedding a browser into your application. (Or if your application is browser based - voila, problem solved.)
If you don't want to handle the remote communication, just have the server-side run on the localhost.(With the nice sideeffect of saving bandwidth.)
Alternatively, if you are feeling adventurous, you could go and write your own WebRTC support on the application side to bypass the need for the browser alltogether. It might not be worth the effort though.
Side note: The first of the links you provided is a feature request which hints at the unfortunate fact that UE4 doesn't support embedding. This is further enforced by the fact that one of the people there says somethig along the lines "Unity can to this, it would be nice if UE4 could as well."
Yet a different approach:
You could embedd and use a virtual display to insert the UE4 part into your controller - you would be basically tricking UE4 into thinking that the desired display device is a canvas inside your application.
This thread suggests a similar approach:
In general, the way to connect two libraries like this would be through a platform dependent window handle, e.g. a HWND under Windows. Check the UE api if you find any way to bind the render target to a HWND. Then you could create a wxWindow in wxWidgets and tell UE to render into that window. That would be a first step.
I'm not sure if anything I've listed will be of much help but hey, at least I tried :-). Good luck with your game.
At the same time, the author suggests to:
Reverse the problem:
Using the UE4 slate framework and online subsystem. You would use the former to create the menus you need directly in the UE4 and then use the latter to link to the logic you want to have outside of the UE4. However that is not what you asked for so I'm listing it only for the completeness sake.

How to setup cmusphinx with lua?

So I wanted to go about designing an add-on for a game I play, World of Warcraft and the game uses Lua scripts. The add-on involves speech recognition. I found a library that apparently adds voice recognition functionality to Lua.
Here is the link to the library: https://github.com/stuarch/speechtotxt-lua
The problem is, I have no idea how to set this up. It looks like they're using linux commands, but can I use this with Windows?
Also, do I have to put all these files in a certain place (pocketsphinx, sphinxbase) like a project folder, and then call them from Lua?
I'm sorry if this a noob question, I just can't find anything online about adding these libraries to Lua, and how to include the pocketsphinx and sphinx base. Any help would be greatly appreciated.
There is a difference between let's say running the full Lua interpreter under Windows and running a Lua interpreter as part of a software like WoW.
They usually restrict the use of Lua to what makes sense for the game. You don't have to reboot the system from within WoW, you also should not be able to manipulate files or even manipulate memory ....
Just imagine you install a WoW addon from the internet and it suddenly deletes all files on your computer. Whooops.
So they simply remove the standard Lua libraries like os, debug, io...
Of course they also don't want you to extend your power beyond those limitations by loading third party code. Hence they remove the require function.
So all you can do in WoW is run restricted Lua code and use the feature set they offer you.
Adding speach recognition to WoW is not possible through the embedded Lua interpreter.

Using Matlab capabilities in xcode project

I am familiar with Matlab and would like to use what I know to add the functionality I am looking for in my iOS application. The title really says it all, I would like my app to be able to use the mathematics capabilities that matlab provides like integrals, derivatives, cross products, etc. not any graphing or any of that but just basic equation solving things. Is there a way to add this functionality to it while keeping my application agile. I have heard of the matlab coder that allow code to be switched from matlab to c or c++ that could be used for an Xcode project. If this is the best solution, is that a very difficult coder to work with? This is my first application, I have literally been working with Xcode and objective-c for a few weeks but I have the basic framework of my application good to go. I need this to add the real functionality to it and make it very useable. Please go easy on me if any of my questions seem obvious, I'm a nube, I really appreciate your answers.
Josh
As you mentioned, MATLAB Coder can generate C code from your MATLAB function. The header (.h) and source (.c) files can be plugged into your XCode project. The key part of the work is to decide what the input and output of the function should be and how to interface the rest of the XCode project with the Coder-generated function. Also, existing MATLAB code may not be completely compatible with the Coder, so that some modifications to your MATLAB code may be necessary. The Coder has interactive processes that guide you through this process.
If you haven't done so yet, you should start by looking at some examples of MATLAB Coder provided by MathWorks, e.g.,
http://www.mathworks.com/help/coder/examples/c-code-generation-for-a-matlab-kalman-filtering-algorithm.html?prodcode=ME&language=en

Charting control options for Silverlight for Windows Embedded

I want to make a charting control for an embedded device using Silverlight for Windows Embedded. Currently i am planning to use line shape for drawing the graph.
My question is if its a good approach(performance wise) or should i look for other options.
Or if any controls are available for SWE.
Thanks
Silverlight is not a proper answer to drawing charts on an Windows Embedded Compact device. You should go for using (or creating) a native GDI element. If performance is very important (e.g. for a fast-updating chart), you might also consider DirectDraw.
The best way in a commercial project would probably be to use a readymade component, such as this one.
You can find somebody else's experiences and advice here for pointers to what to look for when doing this yourself. If you expand your post with more details about what you are actually trying to achieve, I might give you a more detailed response.
The answer is stop using Silverlight, since Microsoft is abandoning the product. Do it in Flash—or better yet, use HTML5 and JavaScript.
In recent windows embedded applications that use windows universal apps I would highly recommend oxyplot.
http://oxyplot.org/
These plots are the best I've found on the internet so far and very easy to use. Best of all they are free. You can get these using a NuGet Package manager which makes getting updates fairly simple.

How to support multiple languages on a microcontroller?

I'm currently working on upgrading a product for the Chinese market. The target is a ARMTDMI7 with a QVGA display. Most resources I've located on the net are targeted at desktop or web programming rather than embedded devices.
Can anyone suggest some tools and
resources that might be useful?
What are the best techniques for
extracting literal strings and
communicating with translators?
I suggest looking at EasyGUI but that depends on what graphics controller you use.
EasyGUI is a tool that simplifies design of user interfaces and comes with complete source code and driver for a varity of display controllers.
For localization you can use EasyTranslate that gives the translater a graphical representation of the interface. This lets the translator see how the translated texts fit on the screen.
EasyGUI is available with unicode support aswell as right to left script.
Freetype might be good for rendering fonts.
www.freetype.org
There are many ARM microcontroller forums which will help you find what you're looking for.
Atmel has a line of ARM7 processors, and they are pretty friendly to those who make a hobby out of this, so there's a lot of information on this processor. It won't be the same, but generally the tools and libraries can be used across the ARM line so you might find some help here - you'll want to focus on the AT91SAM7 series.
If you have more specific questions, you will probably get some reasonable response here.
-Adam
It sounds like you need to upgrade an existing codebase to make it support multiple languages.
If so, the fact that this is on a microcontroller shouldn't be an issue - I'd drop that fromt he title and focus on the language you're using (c?) and ask how to convert your program for internationalisation.
This is a problem many people have solved on a variety of platforms, and the fact this you're on a microcontroller doesn't mean that the same tools and such don't apply - the relevant factor is the language you're using
-Adam

Resources