当前位置:网站首页>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
边栏推荐
- 长安链交易防重之布谷鸟过滤器
- redis的二进制数组命令
- R language plotly visualization: Violin graph, multi category variable violin graph, grouped violin graph, split grouped violin graph, two groups of data in each violin graph, each group accounts for
- 【力扣刷题】11.盛最多水的容器//42.接雨水
- 【力扣刷题】二分查找:4. 寻找两个正序数组的中位数
- 基于STM32+华为云IOT设计的云平台监控系统
- IAR工程适配GD32芯片
- Data analysis - numpy quick start
- 2 三种建模方式
- How to separate jar packages and resource files according to packaging?
猜你喜欢
【蓝桥杯集训100题】scratch辨别质数合数 蓝桥杯scratch比赛专项预测编程题 集训模拟练习题第15题
用Attention和微调BERT进行自然语言推断-PyTorch
Développer un opérateur basé sur kubebuilder (démarrer)
100+数据科学面试问题和答案总结 - 基础知识和数据分析
What is the process of switching C # read / write files from user mode to kernel mode?
(1) Keras handwritten numeral recognition and recognition of self written numbers
Scala 基础 (二):变量和数据类型
[graduation season] a word for graduates: the sky is high enough for birds to fly, and the sea is wide enough for fish to leap
IAR工程适配GD32芯片
长安链交易防重之布谷鸟过滤器
随机推荐
[graduation season] a word for graduates: the sky is high enough for birds to fly, and the sea is wide enough for fish to leap
JS教程之使用 ElectronJS 桌面应用程序打印贴纸/标签
stm32h7b0替代h750程序导致单片机挂掉无法烧录程序问题
Pybullet robot simulation environment construction 5 Robot pose visualization
Which position does Anxin securities rank? Is it safe to open an account?
Swiftui retrieves the missing list view animation
现在券商的优惠开户政策是什么?现在在线开户安全么?
『C语言』题集 of ⑩
C. Inversion Graph
01 backpack DP
SAP OData 开发教程 - 从入门到提高(包含 SEGW, RAP 和 CDP)
Natural language inference with attention and fine tuning Bert pytorch
牛客编程题--必刷101之动态规划(一文彻底了解动态规划)
Codeforces Round #802 (Div. 2)
C语言读取数据
[untitled]
R language plot visualization: plot visualizes the normalized histogram, adds the density curve KDE to the histogram, and uses geom at the bottom edge of the histogram_ Adding edge whisker graph with
Redis顺序排序命令
Failed to upload hyperf framework using alicloud OSS
Failed to get convolution algorithm. This is probably because cuDNN failed to initialize