C .
ODE
G
AMELET
# PyScript Integrate Py-Script into your CG project. Run py-script on web. - [PyScript home](https://pyscript.net/) - [Document](https://docs.pyscript.net/latest/) - [Github](https://github.com/pyscript/pyscript) ## Getting Started Run a py-script ```typescript CG.PyScript.runScriptFromSource('CG.PyScript/test.py'); ``` Open a py-editor ```typescript CG.PyScript.addRepl('User Script Editor'); ``` Customize the looks ```typescript CG.PyScript.setPyscriptStyles({ fontSize: '16px', padding: '10px, fontFamily: 'Courier', }) ``` ## Build-in utils Some CG related utils are embeded and ready to be used. To get the URL of a source file: ```py url = getAppSourceUrl('CG/PyScript/README.md') print(url) ``` To hide or show python console ```py # hide js.hidePythonConsole() # show js.showPythonConsole() ``` To open dialogs: ```py result = await js.dialog.prompt("What's your name?") print("Your name is " + result) result = await js.dialog.confirm("Are you a girl?") print("You are a " + ("Girl" if result else "Boy")) result = await js.dialog.select(["One", "Two"], "Choose one") print("You got a " + (result if result else "What?")) ``` To draw shapes: ```py # draw a line js.draw.line(10, 400, 300, 100, color=0xFF0000, thickness=5) # draw a rectangle js.draw.rect(100, 300, 100, 50, fillColor=0xFFFF00) # draw a circle js.draw.circle(400, 300, 30, fillColor=0x00FF00, lineThickness=5, lineColor=0x00FFFF) # draw a text js.draw.text(500, 400, "Logo", fontSize=16, color=0xFF9900) # draw lines js.draw.lines([{"x":10,"y":10},{"x":200,"y":400},{"x":100,"y":500}], thickness=2) # draw a polygon js.draw.polygon([{"x":10,"y":10},{"x":200,"y":400},{"x":100,"y":500}]) ```
## 介紹 顧名思義,呢隻game嘅目標係要乜鳩都有 但目前得隻PvP,之後會整多幾隻game ## 參與人員 作者: [小貓.來亂。](https://gamelet.online/user/103841224708436137461@google/) 測試: [黑筆。](https://gamelet.online/user/114408600008309824475@google/) 測試: [ovoowovo](https://gamelet.online/user/ovoowovo/) ## 相關作品 [前作](https://civilizationwar.gamelet.online/?version=0.11.19) ## 相關影片 <div class="video-grid"> <div class="video-card"> <a href="https://youtu.be/QvpanBC4pL4"> <img src="https://markdown-videos-api.jorgenkh.no/youtube/QvpanBC4pL4" alt="Video thumbnail" class="video-thumbnail"> <div class="video-info"> <h3 class="video-title">Creator: 火桑Honosan</h3> </div> </a> </div> <div class="video-card"> <a href="https://youtu.be/geGJX4Q45ZU"> <img src="https://markdown-videos-api.jorgenkh.no/youtube/geGJX4Q45ZU" alt="Video thumbnail" class="video-thumbnail"> <div class="video-info"> <h3 class="video-title">Creator: PC魅影世紀</h3> </div> </a> </div> <div class="video-card"> <a href="https://youtu.be/IW9oYhqOr1A"> <img src="https://markdown-videos-api.jorgenkh.no/youtube/IW9oYhqOr1A" alt="Video thumbnail" class="video-thumbnail"> <div class="video-info"> <h3 class="video-title">Creator: 攝影屍</h3> </div> </a> </div> </div> <style> .video-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 20px; } .video-card { border: 1px solid #ccc; border-radius: 5px; overflow: hidden; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); } .video-thumbnail { width: 100%; height: 180px; object-fit: cover; } .video-info { padding: 10px; background-color: #f8f8f8; } .video-title { margin: 0; font-size: 16px; font-weight: bold; color: #333; } </style>
ⒸCode.Gamelet.com | Privacy Policy | Terms of Service