public LineRectangleComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, Color4 color) : base(device) { this.resourceManager = resourceManager; UpdateResource(color); borderThickness = 1; vertices = device.GetModule <ShaderCommon>().CreateVertex(10); }
public Circle(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager) : base(device) { loadCircleImageResource = resourceManager.GetResource <ImageResourceBase>(Utility.Path.Combine("logo", "circle.png")); loadCircleImageVertex = device.GetModule <ShaderCommon>().CreateVertex(362); invLoadCircleImageVertex = device.GetModule <ShaderCommon>().CreateVertex(362); var tempLoadCircleVertices = new ColoredTexturedVertex[362]; var tempInvLoadCircleVertices = new ColoredTexturedVertex[362]; for (var i = 0; i < tempLoadCircleVertices.Length; i++) { tempLoadCircleVertices[i] = new ColoredTexturedVertex(Vector3.Zero); tempInvLoadCircleVertices[i] = new ColoredTexturedVertex(Vector3.Zero); } tempLoadCircleVertices[0].Position = new Vector3(400, 225, 0.5f); tempLoadCircleVertices[0].TextureCoordinates = loadCircleImageResource.GetActualUV(new Vector2(0.5f)); for (int i = 1; i < tempLoadCircleVertices.Length; i++) { var rad = (float)((i - 1) * Math.PI / 180); var uv = new Vector2((float)Math.Sin(rad), -(float)Math.Cos(rad)); tempLoadCircleVertices[i].Position = new Vector3( 400 + loadCircleImageResource.Width / 2 * uv.X, 225 + loadCircleImageResource.Height / 2 * uv.Y, 0.5f); tempLoadCircleVertices[i].TextureCoordinates = loadCircleImageResource.GetActualUV((uv / 2 + new Vector2(0.5f))); } Array.Copy(tempLoadCircleVertices, 1, tempInvLoadCircleVertices, 0, 361); Array.Reverse(tempInvLoadCircleVertices, 0, tempInvLoadCircleVertices.Length); tempInvLoadCircleVertices[0] = tempLoadCircleVertices[0]; loadCircleImageVertex.Write(tempLoadCircleVertices); invLoadCircleImageVertex.Write(tempInvLoadCircleVertices); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="device"></param> /// <param name="manager"></param> /// <param name="resourceManager">リソースマネージャー</param> public EffectObject(PPDDevice device, Resource.ResourceManager resourceManager, EffectManager manager) : base(device) { this.resourceManager = resourceManager; this.manager = manager; manager.Finish += manager_Finish; Alignment = EffectAlignment.Center; PlayType = EffectManager.PlayType.Once; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="device"></param> /// <param name="filename">ファイルパス</param> /// <param name="resourceManager">リソースクラス</param> public NumberPictureObject(PPDDevice device, Resource.ResourceManager resourceManager, PathObject filename) : base(device) { imageResource = resourceManager.GetResource <ImageResourceBase>(filename); if (imageResource == null) { imageResource = (ImageResourceBase)resourceManager.Add(filename, ImageResourceFactoryManager.Factory.Create(device, filename, false)); } UpdateResource(); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="device"></param> /// <param name="filename">エフェクトパス</param> /// <param name="resourceManager">リソースマネージャー</param> public EffectObject(PPDDevice device, Resource.ResourceManager resourceManager, PathObject filename) : base(device) { this.resourceManager = resourceManager; manager = EffectLoader.Load(filename, LoadFunc); if (manager == null) { MessageBox.Show("Failed to load effect:" + filename); return; } manager.Finish += manager_Finish; Alignment = EffectAlignment.Center; PlayType = EffectManager.PlayType.Once; }
private void InnerStruct(Device device, EventManager em, PPDGameUtility gameutility, int[] keychange, PPDEffectManager ppdem, CMarkImagePaths imagepathes, PPDFramework.Resource.ResourceManager resourceManager) { this.device = device; this.gameutility = gameutility; this.em = em; this.keychange = keychange; this.ppdem = ppdem; this.imagepathes = imagepathes; this.resourceManager = resourceManager; cd = new ConnectionDrawer(device, 4); evals = new float[] { PPDSetting.Setting.CoolArea, PPDSetting.Setting.GoodArea, PPDSetting.Setting.SafeArea, PPDSetting.Setting.SadArea }; adjustgaptime = PPDSetting.Setting.AdjustGapTime; CreateResource(); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="device"></param> /// <param name="filename">ファイルパス</param> /// <param name="center">センタリングするか</param> /// <param name="resourceManager">リソースマネージャー</param> public PictureObject(PPDDevice device, Resource.ResourceManager resourceManager, PathObject filename, bool center) : base(device) { imageResource = resourceManager.GetResource <ImageResourceBase>(filename); if (imageResource == null) { imageResource = (ImageResourceBase)resourceManager.Add(filename, ImageResourceFactoryManager.Factory.Create(device, filename, false)); } if (center) { RotationCenter = ScaleCenter = new Vector2(imageResource.Width / 2, imageResource.Height / 2); Offset = new Vector2(-imageResource.Width / 2, -imageResource.Height / 2); } this.center = center; rec = new RectangleF(0, 0, imageResource.Width, imageResource.Height); }
public LoadablePictureComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, SongInformation songInfo) : base(device) { this.resourceManager = resourceManager; this.songInfo = songInfo; this.AddChild(new TextureString(device, songInfo.DirectoryName, 12, 150, 30, true, true, PPDColors.White) { Position = new Vector2(-75, 35) }); this.AddChild((loading = new EffectObject(device, resourceManager, Utility.Path.Combine("loading.etd")))); loading.PlayType = Effect2D.EffectManager.PlayType.Loop; loading.Play(); loading.Scale = new SharpDX.Vector2(0.5f, 0.5f); if (songInfo.IsPPDSong) { thumbPath = Path.Combine(songInfo.DirectoryPath, "thumb.png"); if (File.Exists(thumbPath)) { if (!resourceManager.HasResource <ImageResourceBase>(thumbPath)) { var thread = ThreadManager.Instance.GetThread(LoadTexture); thread.Start(); } else { LoadTexture(); } } else { picture = new PictureObject(device, resourceManager, Utility.Path.Combine("noimage.png"), true) { Scale = new SharpDX.Vector2(0.25f, 0.25f), Alpha = 0 }; this.AddChild(picture); } } else { picture = new PictureObject(device, resourceManager, Utility.Path.Combine("bigfolder.png"), true) { Scale = new SharpDX.Vector2(0.25f, 0.25f), Alpha = 0 }; this.AddChild(picture); } }
public MarkConnectionCommon(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager) : base(device) { var path = Utility.Path.Combine("connectpic.png"); ImageResource = resourceManager.GetResource <ImageResourceBase>(path); ActualUVRectangle = ImageResource.GetActualUVRectangle(0, 0, 1, 1); r = new Random(); Connects = new ColoredTexturedVertex[ConnectionCount][]; for (int i = 0; i < ConnectionCount; i++) { Connects[i] = new ColoredTexturedVertex[SplitCount]; for (int j = 0; j < SplitCount; j++) { int x = -MaxWidth / 2 + MaxWidth / SplitCount * j; Connects[i][j] = new ColoredTexturedVertex(new Vector3(x, 0, 0.5f)); j++; Connects[i][j] = new ColoredTexturedVertex(new Vector3(x, 0, 0.5f)); } } for (int i = 0; i < SplitCount + BaseScale; i++) { UpdateImpl(); } }
/// <summary> /// コンストラクタ /// </summary> /// <param name="device"></param> /// <param name="filename">ファイルパス</param> /// <param name="resourceManager">リソースマネージャー</param> public PictureObject(PPDDevice device, Resource.ResourceManager resourceManager, PathObject filename) : this(device, resourceManager, filename, false) { }
public MarkManager(Device device, EventManager em, PPDGameUtility gameutility, int[] keychange, PPDEffectManager ppdem, CMarkImagePaths imagepathes, Stream stream, PPDFramework.Resource.ResourceManager resourceManager) { InnerStruct(device, em, gameutility, keychange, ppdem, imagepathes, resourceManager); readppddata(stream); CheckGroups(); readppddata(gameutility.SongInformation.StartTime); }
public LineComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, Color4 color) : base(device) { this.resourceManager = resourceManager; UpdateResource(color); }
public MoviePanel(PPDDevice device, MyGame myGame, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device) { this.resourceManager = resourceManager; this.myGame = myGame; this.sound = sound; }
public MovieController(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, MoviePlayer moviePlayer) : base(device) { this.resourceManager = resourceManager; this.moviePlayer = moviePlayer; this.AddChild((moviePos = new TextureString(device, "", 14, PPDColors.White) { Position = new Vector2(0, -9) })); this.AddChild((changeTrimming = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "changetrimming.png"), Utility.Path.Combine("moviecontroller", "changetrimming_select.png"), Utility.Language["ChangeTrimming"]) { Position = new SharpDX.Vector2(-60, 0) })); this.AddChild((seekBackward = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "seekbackward.png"), Utility.Path.Combine("moviecontroller", "seekbackward_select.png"), Utility.Language["SeekBackward"]) { Position = new SharpDX.Vector2(-30, 0) })); this.AddChild((play = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "play.png"), Utility.Path.Combine("moviecontroller", "play_select.png"), Utility.Language["Play"]))); this.AddChild((pause = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "pause.png"), Utility.Path.Combine("moviecontroller", "pause_select.png"), Utility.Language["Pause"]))); this.AddChild((stop = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "stop.png"), Utility.Path.Combine("moviecontroller", "stop_select.png"), Utility.Language["Stop"]) { Position = new SharpDX.Vector2(30, 0) })); this.AddChild((seekForward = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "seekforward.png"), Utility.Path.Combine("moviecontroller", "seekforward_select.png"), Utility.Language["SeekForward"]) { Position = new SharpDX.Vector2(60, 0) })); this.AddChild((getThumb = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "getthumb.png"), Utility.Path.Combine("moviecontroller", "getthumb_select.png"), Utility.Language["GetThumb"]) { Position = new SharpDX.Vector2(90, 0) })); this.AddChild((secLoop = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "secloop.png"), Utility.Path.Combine("moviecontroller", "secloop_select.png"), Utility.Language["FolderLoop"]) { Position = new SharpDX.Vector2(120, 0) })); this.AddChild((oneLoop = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "oneloop.png"), Utility.Path.Combine("moviecontroller", "oneloop_select.png"), Utility.Language["OneLoop"]) { Position = new SharpDX.Vector2(120, 0) })); this.AddChild((randomLoop = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "randomloop.png"), Utility.Path.Combine("moviecontroller", "randomloop_select.png"), Utility.Language["RandomLoop"]) { Position = new SharpDX.Vector2(120, 0) })); this.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("moviecontroller", "back.png"), true)); play.Alpha = 0; loopDict = new Dictionary <MovieLoopType, FadableButton> { { MovieLoopType.One, oneLoop }, { MovieLoopType.Sequential, secLoop }, { MovieLoopType.Random, randomLoop } }; foreach (var p in loopDict) { p.Value.Alpha = p.Key == PPDGeneralSetting.Setting.MovieLoopType ? 1 : 0; } list = new FadableButton[] { changeTrimming, seekBackward, pause, stop, seekForward, getThumb, oneLoop }; this.Position = new SharpDX.Vector2(400, 420); Inputed += MovieController_Inputed; GotFocused += MovieController_GotFocused; }