animations work now
This commit is contained in:
parent
6168798d19
commit
eb6547eb1a
12
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
12
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="ignoredIdentifiers">
|
||||||
|
<list>
|
||||||
|
<option value="logging.Logger.trace" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</inspection_tool>
|
||||||
|
</profile>
|
||||||
|
</component>
|
||||||
6
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
6
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<settings>
|
||||||
|
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||||
|
<version value="1.0" />
|
||||||
|
</settings>
|
||||||
|
</component>
|
||||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
28
.idea/workspace.xml
generated
28
.idea/workspace.xml
generated
@ -5,8 +5,10 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="ae2847d5-ce86-4d84-8e66-f1369f1438e2" name="Changes" comment="">
|
<list default="true" id="ae2847d5-ce86-4d84-8e66-f1369f1438e2" name="Changes" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/pyproject.toml" beforeDir="false" afterPath="$PROJECT_DIR$/pyproject.toml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/uv.lock" beforeDir="false" afterPath="$PROJECT_DIR$/uv.lock" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/starsky_presenter/entry.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/starsky_presenter/entry.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/starsky_presenter/projection/screen.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/starsky_presenter/projection/screen.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/starsky_presenter/resources/scenes.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/starsky_presenter/resources/scenes.yml" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@ -31,18 +33,18 @@
|
|||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent">{
|
<component name="PropertiesComponent"><![CDATA[{
|
||||||
"keyToString": {
|
"keyToString": {
|
||||||
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager": "true",
|
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager": "true",
|
||||||
"RunOnceActivity.git.unshallow": "true",
|
"RunOnceActivity.git.unshallow": "true",
|
||||||
"git-widget-placeholder": "restructuring",
|
"git-widget-placeholder": "main",
|
||||||
"last_opened_file_path": "/home/linus/Desktop/HomeLabProjects/StarSkyPresenter/src/starsky_presenter/main.py",
|
"last_opened_file_path": "/home/linus/Desktop/HomeLabProjects/StarSkyPresenter/src/starsky_presenter/main.py",
|
||||||
"settings.editor.selected.configurable": "preferences.pluginManager",
|
"settings.editor.selected.configurable": "preferences.pluginManager",
|
||||||
"uv run.StarSky Presenter.executor": "Run"
|
"uv run.StarSky Presenter.executor": "Run"
|
||||||
}
|
}
|
||||||
}</component>
|
}]]></component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
<key name="CopyFile.RECENT_KEYS">
|
<key name="CopyFile.RECENT_KEYS">
|
||||||
<recent name="$PROJECT_DIR$/resources" />
|
<recent name="$PROJECT_DIR$/resources" />
|
||||||
|
|||||||
@ -17,6 +17,10 @@ import pygame
|
|||||||
from starsky_presenter.controller.window import ControlWindow
|
from starsky_presenter.controller.window import ControlWindow
|
||||||
from starsky_presenter.projection.screen import Screen, Star
|
from starsky_presenter.projection.screen import Screen, Star
|
||||||
|
|
||||||
|
def dict_update(d1: dict, d2: dict) -> dict:
|
||||||
|
out = deepcopy(d1)
|
||||||
|
out.update(d2)
|
||||||
|
return out
|
||||||
|
|
||||||
def cli_main():
|
def cli_main():
|
||||||
seed(43)
|
seed(43)
|
||||||
@ -25,18 +29,17 @@ def cli_main():
|
|||||||
scenes = yaml.safe_load(reader.open_resource('resources/scenes.yml'))
|
scenes = yaml.safe_load(reader.open_resource('resources/scenes.yml'))
|
||||||
objects = yaml.safe_load(reader.open_resource('resources/objects.yml'))
|
objects = yaml.safe_load(reader.open_resource('resources/objects.yml'))
|
||||||
|
|
||||||
print(json.dumps(objects, indent=4))
|
scene_data = [{ obj['sid']: deepcopy(obj) for obj in objects["stars"] }] + [
|
||||||
print(objects['stars'][0]['sid'])
|
{ obj['sid']: dict_update(obj, scenes[i][obj['sid']]) if scenes[i] and obj['sid'] in scenes[i] else deepcopy(obj) for obj in objects["stars"] }
|
||||||
|
if i < len(scenes) else { obj['sid']: deepcopy(obj) for obj in objects["stars"] }
|
||||||
scene_data = [
|
for i in range(0,8)
|
||||||
{ obj['sid']: deepcopy(obj).update(scene[obj['sid']]) if scene and obj['sid'] in scene else deepcopy(obj) for obj in objects["stars"] }
|
|
||||||
for scene in scenes
|
|
||||||
]
|
]
|
||||||
|
|
||||||
star_references = {}
|
star_references = {}
|
||||||
|
|
||||||
print(json.dumps(scenes, indent=4))
|
print(json.dumps(scenes, indent=4))
|
||||||
print(json.dumps(objects, indent=4))
|
print(json.dumps(objects, indent=4))
|
||||||
|
print(json.dumps(scene_data, indent=4))
|
||||||
|
|
||||||
def setup_star_instance(data: dict) -> Star:
|
def setup_star_instance(data: dict) -> Star:
|
||||||
image_path = f"resources/{data['image']}"
|
image_path = f"resources/{data['image']}"
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import json
|
||||||
|
|
||||||
import pygame
|
import pygame
|
||||||
from pygame import transform, gfxdraw, Vector2
|
from pygame import transform, gfxdraw, Vector2
|
||||||
from math import sin, cos, pi
|
from math import sin, cos, pi
|
||||||
@ -40,10 +42,14 @@ class Screen:
|
|||||||
weight = sin(min(self.scene_time, pi/2)) ** 2
|
weight = sin(min(self.scene_time, pi/2)) ** 2
|
||||||
|
|
||||||
def update_star_scene(star, old, new, weight):
|
def update_star_scene(star, old, new, weight):
|
||||||
star.x = weight*new['x'] + (1-weight)*old['x']
|
star.x = weight*new[star.sid]['x'] + (1-weight)*old[star.sid]['x']
|
||||||
|
star.y = weight*new[star.sid]['y'] + (1-weight)*old[star.sid]['y']
|
||||||
|
star.rot = weight*new[star.sid]['rot'] + (1-weight)*old[star.sid]['rot']
|
||||||
|
star.scale = weight*new[star.sid]['scale'] + (1-weight)*old[star.sid]['scale']
|
||||||
|
|
||||||
|
|
||||||
for star in self.stars:
|
for star in self.stars:
|
||||||
|
update_star_scene(star, scene_data[self.last_scene], scene_data[self.active_scene], weight)
|
||||||
star.alpha += star.rot * delta
|
star.alpha += star.rot * delta
|
||||||
scaled = transform.rotozoom(star.image, star.alpha, star.scale)
|
scaled = transform.rotozoom(star.image, star.alpha, star.scale)
|
||||||
(w, h) = scaled.get_size()
|
(w, h) = scaled.get_size()
|
||||||
|
|||||||
@ -37,7 +37,7 @@ ApplicationWindow {
|
|||||||
width: parent.width * 0.1
|
width: parent.width * 0.1
|
||||||
height: parent.height * 0.1
|
height: parent.height * 0.1
|
||||||
text: "Scene 1"
|
text: "Scene 1"
|
||||||
onClicked: controller_backend.select_scene(1)
|
onClicked: controller_backend.select_scene(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
@ -46,7 +46,7 @@ ApplicationWindow {
|
|||||||
width: parent.width * 0.1
|
width: parent.width * 0.1
|
||||||
height: parent.height * 0.1
|
height: parent.height * 0.1
|
||||||
text: "Scene 2"
|
text: "Scene 2"
|
||||||
onClicked: controller_backend.select_scene(2)
|
onClicked: controller_backend.select_scene(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
@ -55,7 +55,7 @@ ApplicationWindow {
|
|||||||
width: parent.width * 0.1
|
width: parent.width * 0.1
|
||||||
height: parent.height * 0.1
|
height: parent.height * 0.1
|
||||||
text: "Scene 3"
|
text: "Scene 3"
|
||||||
onClicked: controller_backend.select_scene(3)
|
onClicked: controller_backend.select_scene(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
@ -64,7 +64,7 @@ ApplicationWindow {
|
|||||||
width: parent.width * 0.1
|
width: parent.width * 0.1
|
||||||
height: parent.height * 0.1
|
height: parent.height * 0.1
|
||||||
text: "Scene 4"
|
text: "Scene 4"
|
||||||
onClicked: controller_backend.select_scene(4)
|
onClicked: controller_backend.select_scene(3)
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
@ -73,7 +73,7 @@ ApplicationWindow {
|
|||||||
width: parent.width * 0.1
|
width: parent.width * 0.1
|
||||||
height: parent.height * 0.1
|
height: parent.height * 0.1
|
||||||
text: "Scene 5"
|
text: "Scene 5"
|
||||||
onClicked: controller_backend.select_scene(5)
|
onClicked: controller_backend.select_scene(4)
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
@ -82,7 +82,7 @@ ApplicationWindow {
|
|||||||
width: parent.width * 0.1
|
width: parent.width * 0.1
|
||||||
height: parent.height * 0.1
|
height: parent.height * 0.1
|
||||||
text: "Scene 6"
|
text: "Scene 6"
|
||||||
onClicked: controller_backend.select_scene(6)
|
onClicked: controller_backend.select_scene(5)
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
@ -91,7 +91,7 @@ ApplicationWindow {
|
|||||||
width: parent.width * 0.1
|
width: parent.width * 0.1
|
||||||
height: parent.height * 0.1
|
height: parent.height * 0.1
|
||||||
text: "Scene 7"
|
text: "Scene 7"
|
||||||
onClicked: controller_backend.select_scene(7)
|
onClicked: controller_backend.select_scene(6)
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
@ -100,7 +100,7 @@ ApplicationWindow {
|
|||||||
width: parent.width * 0.1
|
width: parent.width * 0.1
|
||||||
height: parent.height * 0.1
|
height: parent.height * 0.1
|
||||||
text: "Scene 8"
|
text: "Scene 8"
|
||||||
onClicked: controller_backend.select_scene(8)
|
onClicked: controller_backend.select_scene(7)
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
@ -109,7 +109,7 @@ ApplicationWindow {
|
|||||||
width: parent.width * 0.1
|
width: parent.width * 0.1
|
||||||
height: parent.height * 0.1
|
height: parent.height * 0.1
|
||||||
text: "Scene 9"
|
text: "Scene 9"
|
||||||
onClicked: controller_backend.select_scene(9)
|
onClicked: controller_backend.select_scene(8)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,4 +1,3 @@
|
|||||||
-
|
|
||||||
- star-bg-01:
|
- star-bg-01:
|
||||||
x: 0.6
|
x: 0.6
|
||||||
star-bg-02:
|
star-bg-02:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user