当前位置:网站首页>JS tutorial using electron JS build native desktop application ping pong game
JS tutorial using electron JS build native desktop application ping pong game
2022-06-26 16:22:00 【Knowledge fatness】
Javascript Gone are the days of being bound by browsers .Electron or Electron.js By OpenJS The framework maintained by the foundation , For the use of JavaScript、HTML and CSS etc. Web Technology to build local desktop applications .

More and more native applications , Such as Spotify、VSCode and Slack, All in use Electron structure !
The open source framework uses Chromium and Node.js, Can be used to create and Windows、Mac and Linux Compatible cross platform applications . In this paper , We will use Electron Build a simple tic tac toe game that can run locally .
Electron.JS Basics
Electron.JS It consists of three main components :
- Deal with all Web Content Chromium
- Handle the interaction with the operating system Node.js
- Customization for additional functions API, And solve common problems when dealing with the operating system
All these components work together to facilitate desktop applications .
Besides ,Electron There are two main processes . Main process processing window management 、 All operating system interactions , The renderer process is responsible for web page content .
The renderer process cannot interact directly with the operating system , You can only communicate with it through the main process . According to the application , A main process can have multiple renderer processes . however , in the majority of cases , Use with to load Web A single main process of a single renderer for an application .
After the explanation , Let's start building .
Set up our project
To use Electron, You need to install... In your environment Node.js. We can create us by running
边栏推荐
- Natural language inference with attention and fine tuning Bert pytorch
- 牛客小白月赛50
- Handwritten numeral recognition, run your own picture with the saved model
- Ten thousand words! In depth analysis of the development trend of multi-party data collaborative application and privacy computing under the data security law
- 2 三种建模方式
- 4 custom model training
- Solidus labs welcomes zhaojiali, former head of financial innovation in Hong Kong, as a strategic adviser
- 最小二乘系统辨识课 中篇:递归最小二乘
- 清华“神奇药水”登Nature:逆转干细胞分化,比诺奖成果更进一步,网友:不靠精子卵子就能创造生命了?!...
- Codeforces Round #802 (Div. 2)
猜你喜欢

Develop operator based on kubebuilder (for getting started)

知道这几个命令让你掌握Shell自带工具

Niuke programming problem -- dynamic programming of must brush 101 (a thorough understanding of dynamic programming)

10 tf. data

用Attention和微调BERT进行自然语言推断-PyTorch

当一个程序员一天被打扰 10 次,后果很惊人!

This year, the AI score of college entrance examination English is 134. The research of Fudan Wuda alumni is interesting

How to implement interface current limiting?

我把它当副业月入3万多,新手月入过万的干货分享!

Net基于girdview控件实现删除与编辑行数据
随机推荐
What is the process of switching C # read / write files from user mode to kernel mode?
Cookie和Session详解
[Li Kou brush question] monotone stack: 84 The largest rectangle in the histogram
C语言读取数据
【时间复杂度和空间复杂度】
(1) Keras handwritten numeral recognition and recognition of self written numbers
请指教同花顺软件究竟是什么?网上开户是否安全么?
I regard it as a dry product with a monthly income of more than 30000 yuan for sidelines and more than 10000 yuan for novices!
NFT transaction principle analysis (2)
MHA switching (recommended operation process)
What is the difference between stm32f1 and gd32f1?
100+ data science interview questions and answers Summary - basic knowledge and data analysis
Natural language inference with attention and fine tuning Bert pytorch
[Blue Bridge Cup training 100 questions] scratch distinguishing prime numbers and composite numbers Blue Bridge Cup scratch competition special prediction programming question intensive training simul
现在券商的优惠开户政策是什么?现在在线开户安全么?
今年高考英语AI得分134,复旦武大校友这项研究有点意思
R语言plotly可视化:plotly可视化归一化的直方图(historgram)并在直方图中添加密度曲线kde、并在直方图的底部边缘使用geom_rug函数添加边缘轴须图
The first open source MySQL HTAP database in China will be released soon, and the three highlights will be notified in advance
【从删库到跑路】MySQL基础 完结篇(入个门先跑路了。。)
Ten thousand words! In depth analysis of the development trend of multi-party data collaborative application and privacy computing under the data security law