//rectangle을 생성한다. 초기에 호출될 함수. //w와 h는 원래의 bitmapimage의 width, height public Board(Brush img, Brush bodyimg, double w, double h, int xpos, int ypos, ILwin.ShowScreen showscreen, Datas datas) { Random rnd = new Random(); this.img = img; this.bodyimg = bodyimg; this.screen = showscreen; this.datas = datas; //생성 imgrec = new Grid(); imgrec.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; imgrec.VerticalAlignment = System.Windows.VerticalAlignment.Top; imgrec.Width = w; imgrec.Height = h; imgrec.Background = this.img; imgrec.Margin = new Thickness(xpos, ypos, 0, 0); screen.sp.Children.Add(imgrec); //마우스 핸들러 연결 //imgrec.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(board_up); makeText(); System.Diagnostics.Debug.WriteLine("board 완성"); }
public Namyong(Brush[] imgs, ILwin.ShowScreen screen, int xpos, int ypos, int dir) { Random rnd = new Random(); namyongBr = imgs; this.screen = screen; this.dir = dir; this.ypos = ypos; this.xpos = xpos; speedTerm = Constants.NAMYONG_SPEED; balloon = new Balloon(Constants.IS_NAMYONG, screen); balloon.showBalloon(dir, xpos, ypos); //생성 namyongRec = new System.Windows.Shapes.Rectangle(); namyongRec.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; namyongRec.VerticalAlignment = System.Windows.VerticalAlignment.Top; namyongRec.Width = Constants.NAYONG_WIDTH; namyongRec.Height = Constants.NAYONG_HEIGHT; namyongRec.Fill = namyongBr[dir]; namyongRec.Margin = new Thickness(xpos, ypos, 0, 0); screen.sp.Children.Add(namyongRec); isGettingKeyword = false; isJumping = false; isComputingRAM = false; }
public Daddy(Brush[] imgs, ILwin.ShowScreen screen, int xpos, int ypos, int dir) { Random rnd = new Random(); daddyBr = imgs; this.screen = screen; this.dir = dir; this.ypos = ypos; this.xpos = xpos; this.speedTerm = Constants.DADDY_SPEED; balloon = new Balloon(Constants.IS_DADDY, screen); balloon.showBalloon(dir, xpos, ypos); //생성 daddyRec = new System.Windows.Shapes.Rectangle(); daddyRec.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; daddyRec.VerticalAlignment = System.Windows.VerticalAlignment.Top; daddyRec.Width = Constants.DADDY_WIDTH; daddyRec.Height = Constants.DADDY_HEIGHT; daddyRec.Fill = daddyBr[dir]; daddyRec.Margin = new Thickness(xpos, ypos, 0, 0); screen.sp.Children.Add(daddyRec); isGettingKeyword = false; isJumping = false; isComputingCPU = false; }
ILwin.ShowScreen screen; //showscreen이 있어야 말풍선을 넣는다. public Balloon(int TALKER, ILwin.ShowScreen screen) { this.TALKER = TALKER; ballImg = new BitmapImage[2]; ballBr = new Brush[2]; textbox = new TextBox(); rec = new Grid(); isShowing = false; ballImg[0] = new BitmapImage(); ballImg[0].BeginInit(); ballImg[0].UriSource = new Uri(Constants.REL_PATH_SPRITE + "trans_leftbal.png", UriKind.Relative); ballImg[0].EndInit(); ballImg[1] = new BitmapImage(); ballImg[1].BeginInit(); ballImg[1].UriSource = new Uri(Constants.REL_PATH_SPRITE + "trans_rightbal.png", UriKind.Relative); ballImg[1].EndInit(); ballBr[0] = new ImageBrush(ballImg[0]); ballBr[1] = new ImageBrush(ballImg[1]); this.screen = screen; //텍스트박스 textbox.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; textbox.VerticalAlignment = System.Windows.VerticalAlignment.Top; textbox.Margin = new Thickness(6, 6, 0, 0); textbox.FontSize = 10; textbox.Width = 110; textbox.Height = 70; textbox.BorderThickness = new Thickness(0.0); textbox.Background = Brushes.White; textbox.IsReadOnly = true; textbox.TextWrapping = TextWrapping.WrapWithOverflow; textbox.Cursor = Cursors.Arrow; //일단은 숨김 rec.Visibility = Visibility.Hidden; textbox.Visibility = Visibility.Hidden; }
ILwin.ShowScreen showscreen; //showscreen 레퍼런스 //생성자는 rectangle을 만들어 추가만을 수행 한다. show screen 참조 정도는 필요하다. public WebItem(ILwin.ShowScreen showscreen, int FallYPos) { this.showscreen = showscreen; this.FallYpos = FallYPos; showscreen.getMWinReference().Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate { this.imgrec = new System.Windows.Shapes.Rectangle(); this.imgrec.Visibility = Visibility.Hidden; //처음엔 숨겨놓는다 this.imgrec.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; this.imgrec.VerticalAlignment = System.Windows.VerticalAlignment.Top; this.imgrec.Width = this.imgrec.Height = 120; //이미지의 너비다. this.imgrec.Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 0)); this.imgrec.StrokeThickness = 2; showscreen.sp.Children.Add(this.imgrec); })); this.imgrec.MouseRightButtonUp += new System.Windows.Input.MouseButtonEventHandler(itemclick); }
public flyingBox(Brush[] boxBr, ILwin.ShowScreen screen, int xpos, int ypos, int dir) { Random rnd = new Random(); this.boxBr = boxBr; this.screen = screen; this.dir = dir; this.ypos = ypos; this.xpos = xpos; //위치 선정 //생성 boximg = new System.Windows.Shapes.Rectangle(); boximg.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; boximg.VerticalAlignment = System.Windows.VerticalAlignment.Top; boximg.Width = boximg.Height = 120; //이미지의 너비다. boximg.Fill = boxBr[dir]; boximg.Margin = new Thickness(xpos, ypos, 0, 0); screen.sp.Children.Add(boximg); }
public MainWindow(ILwin.paraPackage packs) { InitializeComponent(); //init에서 만든 정보들을 모두 받아온다. this.packs = packs; datas = packs.datas; iconBr = packs.iconBr; miniBr = packs.miniBr; xBr = packs.xBr; req_recBr = packs.req_recBr; button1Br = packs.button1Br; button2Br = packs.button2Br; requestSndBr = packs.requestSndBr; requestSndBrClicked = packs.requestSndBrClicked; resp_recBr = packs.resp_recBr; aboutcontentBr = packs.aboutcontentBr; okButtonBr = packs.okButtonBr; marinBarBr = packs.marinBarBr; contentBr = packs.contentBr; bottomBr = packs.bottomBr; boxBr = packs.boxBr; //텍스트박스는 response에 위치한 그곳이다. textbox = new ILtextBox(); //메인 윈도우 바를 만들기 위해 호출. createBar(); //윈도우와 버튼들을 만들기 위해 호출. createLayout(); //윈도우를 만든다. screen = new ShowScreen(showScreenGrid, SCREEN_RECT, this, packs); //텍스트박스는 response에 위치한 그곳이다. textbox.addShowScreenReference(screen); this.requestMachine.Focus(); isRefreshing = false; }